Skip to main content

How to migrate a WordPress site with zero downtime

Migrating WordPress sounds risky because it is usually done badly: people copy the files, forget the database, change DNS immediately, and then chase missing media for a week. Do it in the right order and the cutover is invisible to visitors.

1. Take a full backup first

Take a backup of both the files and the database, and download it somewhere off the server. Never migrate without a rollback you can restore in minutes.

2. Copy files and database to the new host

Upload your wp-content folder and the rest of the WordPress files to the new host, then import the database. Most hosts offer a one-click migration plugin that does both, but understand what it is doing rather than trusting it blindly.

text
# On the old server
mysqldump -u user -p dbname > backup.sql

# On the new server
mysql -u user -p newdbname < backup.sql

3. Fix the URL before you point DNS at it

If the domain is going to stay the same, update the siteurl and home values in the database so WordPress generates correct links once live.

text
UPDATE wp_options SET option_value='https://example.com' WHERE option_name IN ('siteurl','home');

4. Test on a temporary hostname

Before touching DNS, browse the new install using its temporary name (or a hosts-file override). Check the homepage, a blog post, the login screen, a form submission and that images load. Fix problems now, while visitors still see the old site.

5. Cut DNS over with a low TTL

Lower your record's TTL a day in advance so the change propagates quickly. Then repoint the A or CNAME record to the new host. Old and new should both serve identical content, so visitors hit by cache see no difference.

  • Lower TTL to 300 seconds a day before the move.

  • Point the A/CNAME record at the new host.

  • Watch propagation with our free DNS propagation checker.

  • Re-verify HTTPS and any redirects once live.

6. Verify, then decommission

Confirm the certificate matches, run an HTTP header check to be sure HTTPS and redirects behave, then leave the old host running for a week as a safety net before cancelling.

Done in this order, migration is a calm afternoon's work, not a gamble. If you would rather we do it, our web hosting plans include a free migration.