Hosting migration

Moving your website and email to a new host without downtime

Moving truck with swap arrows and a check mark for a completed migration

Your current host is slow, support doesn't answer, or the renewal price has become unreasonable. Deciding to move is easy. The fear is in the execution: the website going down for a day, old emails disappearing, or new client emails going to a server that has already been cancelled. Those fears are justified when the move happens in the wrong order, and every one of them can be avoided.

What is the right order for moving a website and email?

Set everything up on the new host and test it first, then change DNS, then keep the old host running for some days after the switch. The most common mistake is the reverse: changing the domain first and then starting the move.

  1. InventoryWebsites, databases, mailboxes and DNS records
  2. Lower TTLA day or two before the switch
  3. Copy and testWebsite and email on the new server
  4. SwitchChange DNS at a quiet time
  5. Final syncFor emails and orders that arrived during the move
  6. Close the old hostAfter at least a week
A migration order that prevents downtime and lost email

What should you take stock of before moving?

Everything running on the old host, and every record in your domain settings. Whatever you leave out of the inventory you will discover after the old host is gone.

  • Websites and subdomains, and the databases for each.
  • Mailboxes, their sizes, forwarders and autoresponders.
  • Cron jobs that send reports or clean up data.
  • All DNS records: A, CNAME and MX records, and TXT records such as SPF, DKIM and verification records for Google, Microsoft and other services.
  • The PHP version and extensions the website needs.

Take a screenshot of the full DNS page or export it to a file. Old verification records look meaningless until you delete one and find that some tool has stopped working.

Why lower the TTL before moving?

TTL is how long networks keep a copy of your domain's records before asking for them again. If it is set to a full day, some visitors will stay on the old server for up to a day after the switch.

Lower the TTL on the records that will change to about five minutes, at least as long before the move as the old TTL value. Once the move has settled, set it back to a higher value. If you are changing the nameservers themselves, that change goes through the registry for your extension and can take longer, outside your control.

How do you move the website files and database?

Between two cPanel hosts, the easiest route is a full account backup restored on the new server, which moves the files, databases and email together. Otherwise, you copy the files, export the database and import it, then update the config file with the new database details.

Test the site on the new server before switching. You can open it from your own computer only by editing your hosts file to point the domain at the new address, or through a temporary URL your provider gives you. Try the forms, logins and payments if there are any. If the site is a busy online store, plan a final database sync right before the switch, or pause orders for a few minutes while it happens.

How do you move email without losing messages?

Copy the mailboxes to the new server before you change the MX records, then sync again after the switch to catch whatever reached the old server in the last few hours. IMAP sync tools such as imapsync copy folders as they are and skip messages that were already moved.

  • Create the mailboxes on the new server with the same names before anything else.
  • Move messages and folders, including Sent and archived mail.
  • Change the MX records and update SPF and DKIM for the new server, or your messages will end up in spam. The details are in why your company's emails go to spam.
  • Tell staff when the switch will happen, and have their new device settings ready.

If staff use POP3, some messages exist only on their devices and not on the server. Ask about this before the move, since a server sync can't copy what isn't there. We cover setting up email on devices after the move in setting up company email on your phone and in Outlook.

What should you do after the switch?

Watch the website and email for two or three days. Send messages from outside the company and confirm they arrive, and check that an SSL certificate was issued for the domain on the new server. Keep the old host for at least a week, because some sending servers hold on to the old address for a while, and because you may need a file you forgot.

Also check the things that break quietly after a move: cron jobs that were never created on the new server, website forms that send email using an old account password, and outside services that only accept connections from the old server's IP address, such as payment gateways or SMS providers. Any of these can work during testing and stop a few days later with no clear error message.

Don't renew the old hosting for a whole year because of this one week. Plan the move a month before the renewal date so you have enough time without paying twice.

We move websites and email for our clients in this order as part of our hosting, server and email service, and we handle the final sync and monitoring after the switch. Send us your domain name and the number of mailboxes and we will suggest a date and a plan for the move.

Questions our partners ask

Do I have to transfer my domain when I change hosts?

No. The domain can stay with its current registrar, and you only change the nameservers or DNS records to point at the new host. Transferring the domain itself is a separate step you can do later.

How long does a DNS change take to propagate?

It depends on the TTL value the records had. If you lowered it a day or two before the move, most people will see the change within minutes to hours. Changing the nameservers themselves can take longer.

When should I cancel the old hosting?

At least a week after the switch, once you are sure the website works, email is arriving at the new server, and no new messages are reaching the old one.

Written by the Visual Innovate team, the people who build, host and follow up systems, websites and apps for our clients in Jordan, Saudi Arabia, Oman and Egypt.

Are you our next Success Partner?

Tell us the problem as you see it. Within one working day we'll come back with how we understand it and a clear first step.