We recently posted on our Twitter account that we had completed a huge, time consuming move of all our web hosting accounts from Fasthosts which we’d been with since 2001 to new host 20i / Stack.
By far and away the bulk of the web sites were WordPress based sites and involved migrating not just the files but also the database.
Preparing the Migration
Before moving it is essential to make absolutely sure you have all of the files required, so I did a number of steps:
- Export the MySql database
- FTP download all the files
- Backup using BackupBuddy or Duplicator
Once this has been completed, we then imported the site into DesktopServer, a local WordPress development tool to test that the download is fully working.
Uploading to the new host
A good alternative to DesktopServer if you don’t have it is to upload the site straight to a staging server which 20i provide if you select their WordPress package. A staging site can give you a good view of what the site is looking like on the new host.
To upload to a staging site or direct to the new hosting space the simplest way is to install a blank copy of WordPress and you’ll find all the settings you need from the wp-config.php file. Next simply upload all the files (recommend excluding the wp-config.php file) to the new host and import the database via phpmyadmin into MySql (or MySql workbench for large files). Good security is to change the database table name so if you upload all the files and your web site doesn’t appear, this is probably the reason and the table prefix needs to be changed in wp-config.php ($table_prefix = ‘wp_’;).
Testing the Site
To test the web site, find the IP address of the new web site and change your hosts file at c:\Windows\System32\drivers\etc to fool your computer into going to a different IP address than the central domain registry. You will also need to clear IP cache using ipconfig /flushdns from the command line.
Once you have tested the web site and everything is working, then it just remains to change the www and non www a records at your domain registry to the new IP address.