Migrating a website to a new host or domain without downtime: the steps most people skip

A website moves without downtime when the copy is launched and tested on the new server first and DNS is switched afterwards. The sequence: inventory, copy, hosts-file testing, TTL, SSL, email as a separate move, 301 redirects on a domain change and an order pause for a shop.

9 min read

In this article
  1. What to count before you move?
  2. How to copy the site and launch it on the new server?
  3. How to test the new server while DNS still points to the old one?
  4. How to switch DNS so nobody notices?
  5. Why is email moved separately?
  6. What is different when the domain changes?
  7. What happens to shop orders during the switch?
  8. What to do after the migration?
  9. What does the migration price depend on?
  10. What to do tomorrow
  11. Frequently asked questions

A website moves without downtime when its copy is launched and tested on the new server first, and DNS is switched only once everything works there. Downtime does not come from the migration itself but from skipped steps: a DNS TTL that was never lowered, email that was not moved separately, an SSL certificate issued only after the switch, and orders that landed on the old server during the switch-over hour.

Below is the whole sequence from inventory to shutting down the old server, a separate section on changing the domain, and what is different when the site is an online shop. The examples are WordPress, but the steps are the same for any site with files and a database.

What to count before you move?

Most failed migrations start with a question nobody asked: "what else lives on that server?" Before you begin, write down:

  • Files and database: the site directory, uploaded files (photos often weigh more than everything else), database size and version.
  • Email: are the mailboxes on the same hosting? If so, that is a separate migration (see below).
  • DNS records: all of them, not just the A record: MX (mail), TXT (SPF, DKIM, DMARC, Google verifications), CNAME (subdomains, services), SRV.
  • Scheduled jobs: cron tasks, backup scripts, imports that run on the server rather than inside the site.
  • External connections into the site: payment provider webhooks (Stripe, Paysera, Montonio), couriers, accounting, CRM, Meta and Google tags. If only the server changes, the addresses stay; if the domain changes, every one of them must be rewritten.
  • PHP and extension versions: the new server needs at least the same PHP version and the same extensions (for example imagick, intl), otherwise the site starts with errors that have nothing to do with the move.
  • SSL: who issues the certificate now (the host, Let's Encrypt, Cloudflare) and who will issue it on the new server.

If you inherited the site from another developer and don't know some of the answers, sort out the access first, as described in our website maintenance article.

How to copy the site and launch it on the new server?

Two paths, both fine if you know what you are doing:

  1. A migration plugin. WordPress plugins (Duplicator, All-in-One WP Migration, UpdraftPlus and similar) pack files and database into one archive that you unpack on the new server. Good for small and medium sites; archives of many GB often stall on server limits.
  2. A manual move. Files are copied over SFTP or rsync, the database is exported to an SQL file and imported on the new server, and wp-config.php gets the new connection details. Works for every site and is the only option for large ones.

Whichever path you take, make a full backup first and keep it away from both servers. A migration must never be the only copy of the old site.

How to test the new server while DNS still points to the old one?

This is the whole secret of "no downtime". In the hosts file on your own computer you add: new.server.IP yoursite.com www.yoursite.com. Your browser now opens the site from the new server while everyone else still gets the old one. Check:

  • the home page, a few inner pages, search results;
  • the admin area and login;
  • the contact form: does the email leave from the new server;
  • for a shop: the cart, the checkout page in test mode, the account page;
  • images and files: do they all open, does anything point to the old server by full address;
  • the error log on the new server: it reveals missing PHP extensions before the switch.

Once everything works, delete the hosts entry, otherwise after the switch you will see something different from what your customers see.

How to switch DNS so nobody notices?

  • Lower the TTL in advance. 24 to 48 hours before the switch, set the A record TTL to 300 s (5 minutes). If the TTL was 86,400 s (a day), some people will keep seeing the old address for a day after the switch; that is the "downtime", even though both servers are running.
  • Switch at a quiet time. Not on Monday morning and not during a sale.
  • Keep both servers running for a week or two. While DNS propagates, some visitors still arrive at the old one. What happens to their actions is covered in the shop section below.
  • SSL on the new server before the switch. A Let's Encrypt certificate can be issued on the new server through DNS validation before the A record changes, or through Cloudflare if DNS is managed there. If the certificate is only issued after the switch, visitors see a security warning for tens of minutes.
  • After the switch, run the same checklist as through hosts, plus receiving a form email and the payment provider's webhook (a test payment).

Why is email moved separately?

The most common migration mistake: the site moved and the emails disappeared. Mailboxes are a separate service even when they live on the same hosting. Three options:

  • Email stays on the old host's server. You leave the MX records unchanged and keep the old hosting for mail only. It works, but you pay for two servers.
  • Email moves to a mail service (Google Workspace, Microsoft 365, Zoho and similar). Mailboxes are moved by IMAP migration, and the MX, SPF, DKIM and DMARC records are rewritten for the new provider. Usually the best choice: the website server no longer has anything to do with mail.
  • Email moves together with the site to the new host. Mailboxes are migrated separately and MX is rewritten.

The emails the site itself sends (forms, order confirmations) also leave from a new IP address after the move. If your SPF record only listed the old server, those emails start landing in spam. Check SPF and, if you can, send site emails through an SMTP service rather than straight from the server.

What is different when the domain changes?

Moving to a new domain adds four jobs to everything above:

  1. Addresses in the database. WordPress stores the old domain in thousands of places: links in texts, image addresses, theme settings. Some are stored in serialised form, where a plain "find and replace" corrupts the data. Use WP-CLI wp search-replace, which understands it.
  2. 301 redirects from the old domain. Every old address must lead to the same page on the new domain, not to the home page. Keep the old domain for at least a year, until Google and links from other sites catch up.
  3. Google Search Console and advertising. "Change of address" in Search Console; the new address in Google Ads, Meta and the Google Business profile; a sitemap on the new domain.
  4. Every external connection. Payment provider webhooks, OAuth logins, API keys restricted by domain (Google Maps, reCAPTCHA), the email sending domain.

Transferring the domain to another registrar is yet another thing: it changes where you pay for the domain, not where the site runs. You unlock the domain, obtain the transfer code and transfer; if the old registrar also hosted your DNS zone, copy every record before the transfer, otherwise the site and email stop working afterwards. Each extension has its own rules, so check timing and restrictions with your registrar.

What happens to shop orders during the switch?

While DNS propagates, some buyers reach the old server and some the new one. An order created in the old database after the copy was taken does not exist in the new one. Three ways to avoid that:

  • Pause orders during the switch. The simplest and most reliable: for an hour or two the old site shows "checkout temporarily unavailable", the catalogue works, the cart does not. This is how we do it, as described on the WordPress maintenance page.
  • Redirect the old site to the new IP at server level: works if the old host allows it.
  • Reconcile orders after the switch. If a pause is impossible, compare order numbers in both databases a day later and move the missing ones by hand. The riskiest option.

Payment provider webhooks go to the domain, not the IP, so after the switch they reach the new server automatically, provided SSL works there. One more reason to have the certificate ready in advance.

What to do after the migration?

  • Keep the old server running read-only for 1 to 2 weeks, then take a final backup and shut it down.
  • Watch the error log and form emails for a week.
  • Check speed: a new server often lets you enable caching or a newer PHP version; how to measure it is in our website speed article.
  • Update your documentation: where the site is, where the mail is, where DNS is, who has access.

What does the migration price depend on?

The amount of work is set not by how pretty the site is but by its surroundings:

  • Size. A photo archive of several GB and a large database take longer and need the manual path.
  • Email. Whether we move the mailboxes too, and where.
  • Online shop. The order pause, checking payment and courier connections, a test payment.
  • Domain change. Replacing addresses in the database, the 301 map, rewriting external connections.
  • Custom code and an old PHP version. If the site only runs on PHP 7, the new server will need an upgrade first.

Send us the site address and tell us where and why you are moving; within 24 hours we will reply with what we suggest and how long it takes: contacts.

What to do tomorrow

Open your DNS zone and write every record into one file. Look at the A record's TTL. Check where your email lives. Three things that take 20 minutes and remove the three most common causes of migration downtime.

Frequently asked questions

How long does a migration take?

The copy and testing take from a few hours to a few days depending on size; the DNS switch takes minutes and propagation up to a day. A zero-downtime migration takes longer than "copy and switch", but visitors don't notice it.

Can a migration hurt Google rankings?

Changing the server under the same domain: no, as long as addresses stay the same and the site does not get slower. Changing the domain: a temporary dip is unavoidable; 301 redirects and the Search Console notice shorten it.

Can I migrate the site myself?

A small site without a shop and without email on the same hosting: yes, with a migration plugin and this checklist. A shop, a site with email or custom code: hand it to someone who will answer if something goes wrong.

What if the site shows an error after the move?

First check which server you are looking at: a hosts entry or unpropagated DNS often still shows the old one. Then read the error log on the new server; most often a PHP extension is missing or the version differs. How to read WordPress errors is in WordPress site broken after update.

Why do form emails stop arriving after a migration?

Because they leave from a new IP address that is not in your SPF record, or because mail sending is not enabled on the new server. Check SPF and send site emails through an SMTP service.

More posts

All posts