Moving a WordPress Site

In the last few months I’ve had the opportunity to move entire websites to new domains and servers three times. All three times it involved moving WordPress files and databases. Here is some stuff I’ve learned:

  • Backup

    This may seem obvious, but seriously. Backup all the files to your local hard drive and verify that everything downloaded. FileZilla FTP client tells you — and maintains an easily viewable list — of files that didn’t transfer, so you can make sure you have absolutely everything. Also backup SQL files and then take a look to ensure that everything is there. MyPHPAdmin can only download a certain amount so ensure it didn’t truncate the file

    For WordPress, be sure to download absolutely everything. While it may be tempting to “start fresh” with a clean WP install, this has only caused problems for me. If it worked in location A, then just move it wholesale to location B.

  • Find and Replace DB

    WordPress uses the full URL to store and retrieve uploaded content. This means that if you’ve changed your domain name, you’ll need to change all of those URL’s. Make a copy of the SQL backup file to do the find and replace. Basically all instances of the old domain name need to be replaced with the new domain.

  • .Htaccess 301 Redirects

    The best way to do redirects is with .htaccess — google “301 redirect htaccess” for info. I like to have all of these either already included in my .htaccess file for upload with the rest of the site, or on immediate standby for inclusion once the site is uploaded. Either way, you want to ensure all the link juice from the old domain follows to the old site on the new domain.

  • Upload

    The proper way to upload everything would be database first, then files.

  • Test Everything

    Once it’s uploaded, test all your links, administration interfaces, news feeds, etc. Keep an eye on your 404 log for a while just to be sure. For the most part, you’ll be able to tell if something major didn’t work right. If all else fails, delete everything and go back to your backup.

Hopefully you’ll avoid a website-moving horror story with some of these tips. By far, the best thing I’ve done for myself when moving a website is plan and outline how it’s going to happen. Good luck, let us know how it goes.

Leave a Reply

Your email address will not be published. Required fields are marked *