Blog

How to move your site to a new host without downtime

Auteur GazduireOnline.ro
Publié par
GazduireOnline.ro PR

Ce contenu n'est disponible qu'en roumain et en anglais ; le texte anglais est affiché ci-dessous.

Two servers linked by an arrow, with a browser window and an envelope moving between them

You can move a site to a new host without visitors noticing: copy everything, test on the new server before switching, then change the DNS and keep the old hosting running until propagation is done. Here is the full checklist, step by step.

The secret of a zero-downtime move is the order of the steps. As long as the old server keeps working and the new one is already set up and checked, switching DNS just moves people from one good copy to another.

1. Take inventory

Before you touch anything, write down everything on your old hosting. Whatever you forget now, you'll find out about after the move, usually from an unhappy customer.

  • your domains and subdomains, where they're registered (the registrar) and where the DNS is managed;
  • all current DNS records: A, AAAA, CNAME, MX, TXT (SPF, DKIM, DMARC, Google verifications and so on); take a screenshot or an export;
  • databases and their users;
  • mailboxes, forwarders and auto-replies;
  • cron jobs (scheduled tasks), the PHP version and the extensions you use;
  • SSL certificates and any special rules in .htaccess.

And, most importantly: make a full backup and download it to your computer before you start.

2. Lower the TTL a day or two ahead

The TTL (time to live) tells other servers how long they may remember a DNS record. If it's 86400 seconds (24 hours), some visitors may keep reaching the old server for a full day after the switch.

At least 24–48 hours before the move, lower the TTL of your A/AAAA and MX records to something small, for example 300 seconds (5 minutes). You have to wait for the old TTL to expire, or lowering it has no effect. After the move, you can raise it again.

3. Copy the files and database

  1. Set up the plan on the new hosting and add the domain in the control panel.
  2. Copy the site files (usually the contents of public_html), by uploading and extracting an archive, over FTP/SFTP, or with a migration plugin.
  3. Export the database from the old server (for example, from phpMyAdmin) and import it into a new database.
  4. Update the database login details in the configuration file (for WordPress, wp-config.php: database name, user, password, host).
  5. Recreate the cron jobs and choose the same PHP version (or a compatible one).

If the site is an online shop, pick a quiet period and temporarily pause new orders on the old site during the final copy. Otherwise, orders placed between the export and the DNS switch will exist only on the old server.

4. Test through the hosts file

You can see the site on the new server before changing DNS, on your own computer only. Add a line to your hosts file with the new server's IP and your domain:

203.0.113.10 example.ro www.example.ro

  • Windows: C:\Windows\System32\drivers\etc\hosts (open Notepad as administrator);
  • macOS and Linux: /etc/hosts (with administrator rights).

Use the real IP from your new provider instead of the example. Close and reopen the browser, then check the main pages, images, the admin login, the contact form and, for a shop, the cart and payment. When you're done, remove the line from hosts, so you don't stay stuck on the new server without realising it.

5. Prepare e-mail

E-mail is the part most easily lost in a move.

  1. Create the same mailboxes on the new hosting, with new passwords, plus the forwarders.
  2. Copy old messages: with an e-mail client set up via IMAP on both accounts (drag folders from one to the other) or with an IMAP migration tool.
  3. Prepare the new MX and SPF/DKIM records your new provider gives you.
  4. After the DNS switch, keep checking the old mailboxes for a few days and move anything that still arrives there.

If you use a separate e-mail service (for example, from Google or Microsoft), don't change the MX records: move only the site's records.

6. Switch the DNS

You have two options:

  • Change the nameservers at your registrar to the new provider's. First recreate every record from your inventory in the new DNS zone.
  • Keep the nameservers and change only the A/AAAA records (and MX, if you're moving e-mail) to the new server.

The second option is faster, because it follows the low TTL you set. A nameserver change can take longer, sometimes up to 24–48 hours, depending on the registrar and caches around the internet.

On the new server, the SSL certificate can usually only be issued once the domain points to it. Check it right after the switch and enable it if it didn't start by itself.

7. Keep the old hosting until propagation is done

Don't cancel the old plan on moving day. Keep it active for at least a few days, ideally until its next renewal date:

  • some visitors and mail servers will keep reaching the old IP for a while;
  • you have a quick way back if you find a problem;
  • you can recover a forgotten file or message.

Check from several networks (Wi-Fi, mobile data) or with an online DNS checker that everyone already sees the new IP.

8. Cancel the old hosting, last

Only once everything works on the new server, you've checked e-mail and you have a fresh backup downloaded from the new hosting, cancel the old plan. Careful: if your domain is registered with the same provider, cancel only the hosting, not the domain. A domain transfer is a separate step and it's simpler to do it after the site move, not on the same day (see domain transfer).

Quick checklist

WhenWhat you do
2–3 days beforeInventory, full backup, TTL lowered to 300 s
Moving dayCopy files and database, configure, test via hosts
Moving dayCreate mailboxes, copy messages, switch DNS
Right afterCheck SSL, forms, payments, e-mail
A few days afterWatch the old mailboxes, confirm propagation, restore the normal TTL
At the endBackup from the new server, then cancel the old hosting

In short

Inventory, low TTL, full copy, test via hosts, e-mail ready, DNS switch, and the old hosting stays on until everyone reaches the new server. If you want to move your site to us on a web hosting or WordPress hosting plan and need help, write to us at [email protected].

Prêt à lancer votre site ?

Vérifiez si le domaine souhaité est libre ou découvrez en 10 secondes quelle offre d’hébergement vous convient.

ARTICLES SIMILAIRES

Voici d’autres articles qui pourraient vous être utiles. Nous publions des informations pertinentes et pratiques pour nos lecteurs.

ABONNEZ-VOUS À LA NEWSLETTER

Abonnez-vous à notre newsletter et à nos communications marketing. Nous vous enverrons nos nouveautés et nos offres.

Illustration abonnement à la newsletter