There’s a plugin I’ve just discovered called WP Migrate DB that makes migrating your site to a new server or a new domain name very easy. (These steps may seem long, but this plugin really makes the process far easier than it has been in the past.)
- Get your new site ready for migration. First, make sure both the old and new sites are running the same version of WordPress. Then setup the new site to have the same admin name and admin password as the old site. (The admin name and pw is not critical – it will be reset to the old site’s in the end anyway.)
- Make sure the new site is running and works. If you are just moving hosts, then the new site might not really be accessible – so just follow these instructions carefully, and it should come up after the DNS name server is changed.
- Delete the entire /wp-content directory from the new site. Copy the entire contents of the old site’s /wp-content to the new site. This will include all the themes, plugins, and upload content (media, for example). You can do this however you like – make a zip file on the old site using cPanel, download to your computer, upload to the new site, and unpack is one way. You can use FTP to download the old contents and re-upload to the new site.
- Install WP MIgrate DB on your old site.
- Open the WP MIgrate DB admin page. Fill in the name of the new site (it can be the same as the old one if you are just migrating servers.) and the full path name where the site is hosted. This will likely be different for the new server, even if the site name stays the same.
- Save the database from the old site to your computer.
- Open the mySQL database manager on the new site (phpMyAdmin most likely.) Select the database name used for the new site. It should exist and be populated since you setup the new site to work.
- Select the Structure view of the database, click the Check All option at the bottom, and finally “With Selected” pick “Drop”. Then Go. This will clear all the entries in the database for the new site. (The new site won’t function now because the database just got emptied, but that will get fixed soon.)
- Now pick the Import tab, and select the file downloaded in step 6. Upload that file.
- You new site is ready to go. If you changed the domain name, it will work under the new name. All the media will be sourced from the new site. The admin and any users will still be there with the same names and passwords. All the plugins and sidebars should still be there. In other words, you’ve completely cloned your old site – but it will run on a new host or under a new domain name.
- If you are moving to a new host, you should now update the name server on your domain manager account. This will switch the site from being served from the old host to the new host. This may take several hours, even a day, and you may get the site served from one or the other host overlapping for some visitors. One thing you can do after you’ve moved all the files and the data base, but before you switch the nameserver, is to put the old site into maintenance mode, or change the home page to “Move in progress” or some such. Then change the nameserver. When the change has been propogated, the new site will be displayed, and the maintenance mode message will go away. Then you can delete or cancel your account on the old host.
I tried this process – moving one domain name to a new domain name, and it worked perfectly (well, I forgot to update WP on the new site, so had to post-update it to get everything working again). This is a really great plugin, and the move/clone process is now very easy and reliable. It was totally a non-thinking process: set up the new host, copy /wp-content, clear the new database, use the WP MIgrate DB plugin to fix and download the old database, and load the old site’s db to the new site. All very clear, mechanical steps. Took me about 10 minutes (although the move was to the same server which made copying /wp-content very fast.)