Why move hosts?

Why would I want to move hosts? This question has a number of answers. It may be that you are not happy with your current providers, or you have found a better deal elsewhere. It may be that you are growing fast enough to outstrip your current host’s capabilities. Regardless of the reason, when moving hosting providers it is preferable, if not essential, to have as little downtime as possible. To do this, your site needs to be migrated to the new server before the change takes place.

How to move hosts?

Set up new hosting space

First off, you will need to set up your new hosting account. Your hosts will be able to guide you through setting up your account and webspace if you are not sure how this is done. You do not want to transfer the domain yet, so do not change the DNS settings for the domain. You should be given access to your web space via a temporary URL. It is also worth taking a note of the new server’s IP Address, as this will be needed later

Set up wordpress on temp domain

Install a fresh version of WordPress on the temporary domain. Instructions on how to do this can be found in the WordPress Codex. After installing and setting up WordPress, install and activate UpdraftPlus. Installation instructions can be found here

Set time to live to minimum

On your old server, you will need to set your DNS Time to Live (TTL) as low as possible. This will tell the internet to not cache the DNS too long, so people are not sent to your old server once the change has been made. It is better to do this early, to allow the change to spread. Instructions on changing the TTL can be found from your hosts.

Migrate the backup

It is now time to migrate your site. This can be done using any method from our Migration Guide. The one difference to the standard instructions there is that you do not select the ‘Search/Replace Database’ option when restoring the backup to the new server. This will ensure that your WordPress installation is ready for the new URL.

Set your hosts file to direct to your new site

You will now no longer be able to access the site on the new server, as WordPress is not configured for your temporary URL. To be able to access and work on the site, you will need to edit your machine’s hosts file.

You will need to configure your host file to override the DNS on your local machine. You will need to add something like the following to your hosts file:

127.0.0.1 www.example.com

You can find your new IP address on your hosting account. Beginner Geek has a good basic guide on how to edit host files on most operating systems.

This allows you to access your new location from your machine using your domain, while other people are still able to access the original site until the domain is transferred.

Change internet DNS

After any last changes have been made on the new site, you are ready to change the DNS records to point to your new server. Your web hosts can provide instructions on changing the DNS settings.
Once the DNS has fully updated, you can remove the changes to the hosts file.