How to move WordPress site to a new server with zero downtime

Update: I recommend using ManageWP to easily backup/restore/migrate your WordPress sites.

It often comes as a topic and I decided to write a quick tutorial on how to move your WordPress site from one host to another with zero downtime.

 

I will assume you are familiar with basic operations like database backup and FTP. So in order to transfer WordPress to new server you need to follow these steps:

 

  1. Backup the database from the old site and import it to the new site. Pay attention to database names.

  2. Change your wp-config.php in the old site to point to the database on the new site. Your old site will now run using database based on the new site and once you change the nameservers new site will have the up to date database. (You may want to check with your new hosting if they allow outside database access first. If not, you can skip this step and transfer the database at the end, when the nameserver change propagated)

  3. Backup your entire WordPress installation from the old site (this will include all your uploads, themes, plugins)

  4. Unpack your WordPress installation to the new site

  5. Change wp-config.php on the new site with new database details

  6. Change the nameservers to point to the new site

  7. That’s all now you only need to wait 🙂

 

Since nameserver propagation can take up to one day, step 2 allows you to have up to date database at the moment it happens. Downside to this is slower site response in the meantime because site still runs from the old server and the database is on the new. But if you do this over the night or periods of low traffic it won’t be that noticeable and you will not lose any comments or other activity on your site.

Update: You can use ManageWP to move a WordPress site with less hassle.