Skip to content
New: Laravel Hosting, Node.js Hosting & GitHub DeploysSee the plans →
Products
Solutions
Developers

Guides

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

Why moves go wrong, the preview-first order of operations that avoids it, and the checks worth doing before you touch DNS.

Introduction

A WordPress move usually goes wrong when the domain is pointed at the new host before anyone has confirmed that the new host works. Visitors then see the failure while you debug it. You may avoid this by copying and checking the site first, and only then changing DNS.

Moving the Site

Follow these steps in order:

  1. Copy the site to the new host. Copy both the files and the database. Your old host stays live and keeps serving visitors.
  2. Open the copy on a preview URL. The new host gives you a temporary address that bypasses DNS, so you can load the site on the new server while the public still sees the old one.
  3. Fix any problems the copy shows. See Checking the Preview for what to test.
  4. Lower the DNS TTL. Set it to 300 seconds at least a few hours before you plan to switch. Resolvers then cache the old answer for less time, so the switch propagates in minutes rather than hours.
  5. Point DNS at the new host. Both copies are working, so visitors reach one or the other and both serve the site.
  6. Leave the old host running for a few days. Some visitors will keep reaching it until every resolver has caught up.

Because the domain never points at a copy that does not work, this sequence involves no downtime.

Checking the Preview

Homepages are the most cached and most static pages on a site, so loading one proves very little. You should also check the following:

  • Log in to wp-admin. Session and cookie problems appear here first.
  • Submit a form. Contact forms fail silently when mail is not configured on the new host.
  • Complete a test checkout if you sell anything. Payment callbacks are configured per site and often point at the old server.
  • Load a few images and uploads. Broken media usually means the uploads directory was not copied, or file permissions changed.
  • Open a page with a query string to reach something the cache has not stored.
  • Compare PHP versions. A site running on PHP 7.4 may hit a fatal error on 8.3. If your new host has a per-site PHP selector, match the old version first and upgrade later.

Changing URLs in the Database

WordPress stores absolute URLs in the database, including inside serialized data. A plain find and replace over a SQL dump corrupts serialized arrays, because the stored string length no longer matches the string. Settings and widgets then disappear with no visible error.

You should use a tool that understands serialization, such as WP-CLI’s search-replace:

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

If only the host is changing and the domain stays the same, you do not need this step.

Moving Email

Moving the site does not move your mailboxes. If you point the nameservers at a new host without recreating the MX, SPF, DKIM, and DMARC records, mail will stop reaching you.

Decide before the switch whether mail is moving too. If it is, the mailboxes must be copied and the records recreated. If it is not, the records must be carried over to the new DNS exactly as they were.

Managed Migration

We perform this work for free on every plan, in this order. We copy the site across, you check it on a preview URL, and nothing changes on your old host until you tell us to switch. Most sites are ready to preview within 24 hours, and on WordPress Hosting each one runs in its own container with the WP Toolkit and WP-CLI.

Keep reading

Other guides

Start building today

Laravel apps with queues and Horizon, WordPress stores, Node.js servers. One container with SSH, deploys from GitHub and people who answer. One bill a year.

Launch my site