Milon Hossen

Moving a WordPress site to a new host without downtime

A step-by-step plan for migrating WordPress to new hosting: preparing DNS, copying files and the database, testing before the switch and what to check afterwards.

Milon Hossen

Milon Hossen

WordPress & Elementor specialist

4 min read

HeaderFooterENTIRE SITEWordPress

Moving a WordPress site to a new host sounds risky, and done in a hurry it is. Done in the right order, visitors never notice. This is the order I follow.

1. Lower the DNS TTL a day ahead

DNS records have a time to live, which tells the internet how long to remember them. If yours is set to a day, some visitors will keep reaching the old server for a day after you switch.

A day or two before the move, lower the TTL on the domain's A record (and www) to something short, like five minutes. When you switch, the change spreads quickly.

2. Check the new server matches

Before copying anything, make sure the new host runs:

  • the same or a newer PHP version your plugins support
  • the PHP extensions WordPress needs, and enough memory for your plugins
  • a recent MySQL or MariaDB version

Moving to a newer PHP version at the same time as moving host makes problems harder to trace. If you need both, do them one at a time.

3. Take a full backup

Files and database, from the old host, stored somewhere off both servers. If anything goes wrong, this is your way back. More on that in WordPress backups that actually work.

4. Copy the files and the database

For small sites, a migration plugin does the whole job. For larger sites I prefer doing it directly: copy the files over SFTP or SSH, export the database with WP-CLI and import it on the new server.

wp db export site.sql
wp db import site.sql

Then update wp-config.php on the new server with the new database name, user and password.

If the domain stays the same, there's nothing else to change in the database. If it changes, replace the old address everywhere with WP-CLI, which also handles WordPress's serialized data correctly:

wp search-replace 'https://old-domain.com' 'https://new-domain.com' --skip-columns=guid

5. Test before anyone else sees it

You can visit the site on the new server before changing DNS by pointing the domain to the new server's IP address in your computer's hosts file. Then check:

  • every main page, the menu and images
  • logging in to the dashboard
  • forms, search and, on a shop, a test order
  • permalinks (re-save them under Settings → Permalinks if inner pages return 404)

6. Freeze changes on busy sites

On a shop or a site with comments and form submissions, anything that happens on the old server after you copied the database is lost after the switch. For a shop, I schedule the move for a quiet hour, put the old site into maintenance mode, copy the database one last time, and then switch.

7. Switch DNS and keep the old host

Point the A records at the new server. Thanks to the short TTL, most visitors arrive there within minutes. Set up the SSL certificate on the new host as soon as the domain points to it, and check that http redirects to https.

If your DNS is also moving, copy every record first, especially the MX records for email. Forgetting them is the most common way a migration breaks a company's inbox.

Don't cancel the old hosting straight away. Keep it for a week as a fallback, then raise the TTL back up.

After the move

  • Run Core Web Vitals and PageSpeed checks to confirm the new host is actually faster
  • Make sure backups and scheduled tasks (WP-Cron or a real cron job) run on the new server
  • Watch Search Console for crawl errors over the next few days

Planning a move? Tell me about your site and I'll handle the migration with you.

Share this article

Milon Hossen

Milon Hossen

WordPress & Elementor specialist

I build Elementor websites and clean up hacked WordPress sites. If yours needs either, send me a message.

Get in touch

/contact

Have a similar project?

Send me your site’s address and a few lines about what you need: a new Elementor site, a malware cleanup or a fix to an existing build. The first audit is free.

Book a free audit