Skip to content

How to migrate a WordPress site to a new host without downtime

Updated 7 min readBy the DNSPeek team

To move WordPress without downtime, keep the old host running while you copy the files and database to the new one, and test the copy on the new server before you change DNS. Lower the DNS TTL a day ahead, freeze content for the final sync, then point the A record at the new IP. Visitors are served by one server or the other at every moment, so nobody sees an outage.

Where WordPress downtime actually comes from

Copying a WordPress site is rarely the hard part. Downtime usually comes from the moment of the switch: DNS points at a server that is not ready, the database connection fails, the certificate is missing, or a forced-HTTPS rule loops. Each of those can be found before the switch if you can open the site on the new server while the world still sees the old one.

The approach in this guide is simple: the old server keeps serving visitors until the new one has been checked page by page. DNS is changed only once, with a short TTL, so the change spreads within minutes instead of hours.

Before you start

  • Access to the old host (files and database, or a control panel), the new host, and the DNS provider for the domain. The DNS provider is wherever the nameservers point: often the registrar, sometimes Cloudflare or the old host.
  • A full backup of the current site that you have downloaded, not one that only lives on the old server.
  • The new server’s public IP address. If you are not sure which one it is, see Find your server IP.
  • The PHP and database versions of the old site. Match them on the new server, or check that your theme and plugins support the newer versions.
  • A list of the pages that matter: home, a post, a category, search, the contact form, the cart and checkout if you run WooCommerce, and wp-admin.

Check the current TTL of the domain’s A record now with the TTL checker. You need to know it for the timing in step 1.

Step by step

  1. Step 1: Lower the TTL a day ahead

    In your DNS panel, set the TTL of the A record (and AAAA, if any) to 300 seconds, still pointing at the old server. Wait at least as long as the old TTL before you switch. See Lower your TTL before a migration.

  2. Step 2: Back up the old site

    Take a full backup of files and database and download it. This is your rollback plan if anything goes wrong.

  3. Step 3: Copy files and database to the new host

    Use a migration plugin, the host’s transfer tool, or a manual copy with WP-CLI. Keep home and siteurl set to the production domain.

  4. Step 4: Open the site on the new server

    Create a preview link with your domain and the new IP. Click through the key pages, sign in to wp-admin and upload an image to confirm file permissions.

  5. Step 5: Run a QA crawl

    Run a QA report on the preview to catch broken pages, missing uploads, redirect loops, mixed content and hard-coded URLs. Fix and run it again.

  6. Step 6: Freeze content and do a final sync

    Stop new orders, comments and posts on the old site for a few minutes, then copy the database once more so nothing written since the first copy is lost.

  7. Step 7: Switch DNS

    Point the A record of the domain and of www at the new IP. Update or remove any old AAAA record so IPv6 visitors do not keep reaching the old host.

  8. Step 8: Watch propagation and keep the old host

    Track the change with the DNS propagation checker. Keep the old hosting for a few more days, until its access logs show no real visitors.

Plugin or manual copy?

Both work. Choose by site size and by how much access you have on each side.

Ways to copy a WordPress site
MethodGood forWatch out for
Migration plugin (export and import an archive)Small and medium sites, shared hosting without SSHUpload size limits on the new host, timeouts on large archives, free tiers that cap the archive size
Host’s migration service or panel transfercPanel-to-cPanel moves, managed WordPress hostsWhat is included: email and cron jobs are often left out
Manual: files plus a database dumpLarge sites, VPS, anyone with SSHSerialized data: always replace URLs with WP-CLI, never with a plain text editor

For a manual copy, the commands look like this. Run the export on the old server and the import on the new one:

Terminal
# Old server: export the database and pack the files
wp db export site.sql
tar -czf site-files.tar.gz --exclude=wp-content/cache .

# New server: unpack, import, check the site URL
tar -xzf site-files.tar.gz
wp db import site.sql
wp option get home
wp option get siteurl

If the new host gives you different database credentials, update DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php before you test.

Keep the real site URL

WordPress stores its own address in the database (home and siteurl) and builds most links from it. A common mistake is changing them to the server IP or a temporary hostname to test the new server. That works until the switch, and then every hard-coded link points at the temporary address.

Leave both values set to the production domain, such as https://example.com, and test the site under that name. A DNSPeek preview link does exactly that: it connects to the new IP and asks for your real domain, so WordPress behaves as if DNS had already moved. Links, redirects and login cookies are rewritten to the preview address, so you can sign in to wp-admin and click through the site. More in the docs: Preview a WordPress site on a new host.

Restored on a temporary address?

If the site was built or restored on a temporary hostname, find and replace it with wp search-replace (dry run first, backup before). A QA report lists leftover links to staging hosts or raw IPs under hard-coded URLs.

HTTPS before and after the switch

Many hosts issue a free certificate only after the domain points at them, because the domain check runs over HTTP on the domain itself. Before the switch, the new server may present a self-signed or default certificate. That is normal and not a reason to delay.

In a DNSPeek preview, set the link’s SSL mode to Skip verification while the certificate is missing. Otherwise a forced-HTTPS plugin or rule can redirect in a loop when the preview falls back to HTTP. After the switch, confirm the real certificate with the SSL checker. Details: SSL modes.

WooCommerce, memberships and busy sites

On a shop or a site with logins, new data keeps arriving on the old server until the switch. Orders, comments and new accounts created after your copy would be lost. Plan a short content freeze: announce a maintenance window for new orders, or put the old site in maintenance mode only for the minutes of the final database sync. Pages keep loading for readers either way.

Payment gateways and sign-in providers only know your real domain, so they send customers back to whichever server public DNS points at. Test checkout with a test gateway on the preview, then place one real or sandbox order right after the switch. See what previews can’t do.

WordPress migration checklist

Before and after the switch

  • TTL lowered to 300 seconds at least one old TTL before the switch
  • Full backup downloaded and stored off the old server
  • PHP version and extensions on the new server match the site’s needs
  • home and siteurl still set to the production domain
  • Home, posts, search, forms and wp-admin checked on the new server
  • Media upload works (file permissions)
  • QA report: no critical findings left
  • Certificate plan: issued right after the switch, or already valid
  • Content freeze and final database sync done
  • A records for the domain and www updated, AAAA updated or removed
  • Checkout or sign-in tested again after the switch
  • Old host kept until traffic has stopped

Frequently asked questions

Will my WordPress site go down during the migration?

Not if the old host keeps running until DNS has moved. Visitors whose resolver still has the old address reach the old server, everyone else reaches the new one, and both serve the same site. Downtime only happens if DNS points at a server that is not ready, which testing before the switch prevents.

Should I change the WordPress Address to the new server IP for testing?

No. Keep the WordPress Address and Site Address on the production domain. Changing them to an IP or temporary hostname leaves hard-coded links behind after the switch. Test the new server under the real domain instead, with a preview link or a hosts file entry.

How long does a WordPress migration take?

Copying a small site takes minutes; a large media library or database can take hours. Add the waiting time for DNS: with the TTL lowered to 300 seconds in advance, most visitors reach the new server within minutes of the switch.

What happens to my email when I move WordPress?

That depends on the MX records. If email is hosted by the same company as the old website, moving DNS or cancelling the old host can break email. Check the MX records before you start and recreate them at the new DNS provider if you move DNS too.

Do I need a new SSL certificate?

Usually yes, issued by the new host. Many hosts can only issue it after the domain points at them, so expect a few minutes without a valid certificate on the new server, or ask the host to install your existing certificate before the switch.

Moving a site? Use the migration checklist

Every step from lowering the TTL to checking email after the switch, on one printable page. With a free account you keep your preview links in one place and run a QA report of the site on the new server.

Check the new server before you switch

DNSPeek gives you one HTTPS link that shows your site from the new server while DNS still points at the old one. Open it on any device, share it with your team or client, and run a QA crawl on the same link.

Create a free preview link