WordPress manual migration tips
Generally speaking, many people that using wordpress tend to find some plugins to do the migration job or backup of their website. Actually it is rather easy to do migration without using third party plugins.
Here comes the rough process and some tips.
- Copy all your wordpress site files to local. It may take a long time if you download the entire site file by file. So better way is to login to your vps and
tar -czvf
to make a blog.tar.gz file of the whole site. - Export your wordpress database from your database system(.e.g mysql). I usually use oneinstack(oneinstack.com) as my lamp environment, so by default I have phpmyadmin to export a blog.sql file for my blog site.
- remember to copy your vhost config files to local directory for later use. As I said I’m using
oneinstack
, So the vhost config files are under/usr/local/nginx/conf/vhosts
. - upload
blog.tar.gz
to your new server and thentar zxvf
to extract the files. - import the
blog.sql
file to your new database. - Copy your nginx vhosts config files to your new nginx server where
nginx.conf
indicates. ( e.g, inside nginx.conf there may be a line saying “include ./vhosts/*”).
That’s all.
If your new lamp environment is with a different domain name, change your DNS configuration to the new server’s ip address or CNAME if you only have a CNAME for your new VPS.
As you’re using new domain name for your wordpress website, you have to login into your database and change wp_options
table. Find rows with name siteurl
and home
( should be the first row and second row of this table), change them to your new domain name. Bown~. It is done!
You would encounter 404 problem when visiting an individual post page if you have ever setup your permanlinks to something other than plain
( the default config in wordpress.). Login to your wp-admin backend, and change it to plain
. The config is under `Settings->Permanlinks->plain (http://blog.kiwikiwi.fun/?p=123).