Websites By Liz

Web Design for Small Businesses

How to Move a WordPress Site

I’ve done a lot of these lately. Moving wordpress sites. Sometimes it’s because I’ve made a new version of the site and it needs to be moved from a sub-folder up to the main, live site. Very often it’s from one hosting company to another.

If it’s just from a sub-folder to the main directory, it’s as easy as just grabbing all of the files in an ftp program and moving them up to the root directory. Then you also have to update all of the links and image locations, which can be done manually or using a plugin called Update URLs. It’s also a good idea to reset the htaccess file by going to Settings > Permalinks and clicking “Save Changes” even if you haven’t changed anything. Easy, easy.

If your moving the site from host to host, it’s a whole other can of worms. Sure you could install wordpress on the new location and go to Tools > Export in your wordpress admin section, then import into the new location. But then you have to install your theme and plugins, reset all of your plugin settings, your menu, your widgets… on and on. Here’s the process I follow, which is pretty technical, but is relatively quick and very accurate.

  1. Download all of the wordpress files and folders (making sure to include everything within the wp-content folder) into a temporary folder on your computer and export the wordpress mySQL database from the old location.
  2. Create a new database and database user at the new location, and assign the user to the database with full permissions.
  3. Log in using phpMyAdmin or any mySQL editor that’s available and import the database content.
  4. Go into the “wp_options” table in the database and find two entries with the domain. Change both of those to whatever is the temporary domain for the new account (this can often be found in your host’s help files or sometimes in the cPanel).
  5. In the files you downloaded from the old location, edit the wp-config.php file with the new database username and password you created in step 2. (Sometimes the “DB_HOST” line needs to be edited, too, but it’s almost always “localhost” and doesn’t need to change.)
  6. Upload all of the files and folders from the old location.
  7. Log in to wordpress using the temporary domain from step 4 followed by “/wp-admin”. Set the htaccess file by going to Settings > Permalinks and clicking “Save Changes” even if you haven’t changed anything.
  8. Check to make sure everything is in working order. Do not use the Update URLs plugin, because when we’re done, the domain will be identical to the original site.
  9. Move the domain.
    1. If you’re transferring the domain, you’ll need to go through the process of unlocking the domain and multiple confirmations from both the old and new registrar. I won’t go into that here, because it’s slightly different from one registrar to another.
    2. If the domain is going to stay where it’s currently registered, you’ll just need to update the nameservers. Instructions can be found in your registrar’s help files.
  10. After the domain change has propagated, repeat step 4 to change back to the correct domain.
  11. Check through the site again to make sure everything is good and happy. Click on EVERYTHING.

Ok, maybe you tuned out by step 3 or so. Maybe before that. That’s ok, though. I’ve done this lots of times and am completely comfortable with the process. I’m happy to do it for you, besides, above is the ideal process. There are other things to consider:

  • If there are email accounts with the old host, those will have to be moved over.
  • If there are any custom settings on your domain, that will have to be taken into account.
  • If you access your control panel via your domain, you will not have access to it after the domain is transferred, so act accordingly.
  • Sometimes there are issues exporting or importing the database.
  • Some hosts are a bit wonky and don’t work like other hosts.
  • Domain propagation can be confusing if you’re not accustomed to it. There are a few tricks that sometimes need to be used to make sure you don’t have your wires crossed.

For me, this process usually takes anywhere from 15 minutes to up to a couple of hours, depending on the complexity of your setup. If you need help, I’m just a quick email away!