How to move a website to a new host without downtime
Changing hosts sounds risky, and that fear keeps a lot of people on a service they stopped liking years ago. It doesn't have to be. Done in the right order, a move produces no visible downtime at all, because the old site keeps serving visitors right up until the moment the new one takes over. This guide walks through that order.
What actually moves
A website is four separate things, and each one moves differently. Knowing which is which prevents most migration disasters.
- Files: your themes, plugins, uploads and code. A straight copy.
- The database: your posts, pages, products, orders and settings. Exported as a file, then imported at the other end.
- Email: mailboxes and the messages already in them. This is separate from the website, and it is the part people forget.
- DNS: the records that tell the world where your domain points. This is the switch you flip at the end, not the beginning.
Before you start
Half an hour of preparation saves a bad weekend. Work through this list first:
- Take a full backup of the current site, files and database, and download it to your own computer. Do not rely on a backup that lives only on the host you are leaving.
- Write down every email address on the domain and check whether anyone still uses it. Abandoned mailboxes often hold mail somebody wants.
- Find out where your domain name is registered. It may be a different company from your host, and that is where the DNS change happens.
- Note anything unusual: scheduled tasks, custom PHP settings, redirects, or a payment gateway locked to a fixed IP address.
- Check your current plan's renewal date so you are not paying two hosts longer than necessary.
The order that avoids downtime
The trick is that you build the new site completely before you tell anyone about it. Nothing your visitors see changes until the last step.
Copy the files and database to the new host, set the site up there, and get it working. Then test it before any DNS change, using a temporary address the host provides or by editing the hosts file on your own computer, which makes only your machine see the new server. Fix anything broken while the old site is still happily serving everyone else.
Only when the new copy works do you change DNS. Because both copies are live at that point, visitors land on one or the other and both work.
How the DNS cutover works
Every DNS record carries a TTL, or time to live, measured in seconds. It tells other computers how long they may remember the answer before asking again. A TTL of 14400 means some visitors will keep using the old address for up to four hours after you change it.
So lower the TTL first. A day or two before the move, set it to 300 seconds. Wait for the old, longer TTL to expire, then make the change. The switch now propagates in about five minutes instead of half a day. Put the TTL back up afterwards.
This is the single most useful trick in migration, and almost nobody does it.
Email is the part people forget
Website files and mailboxes are different systems, and moving one does not move the other. When the MX record changes, new mail starts arriving at the new host. Mail already sitting in the old mailboxes stays there, and it is not copied across automatically.
Either move the mail first using an IMAP transfer tool, or leave the old mailboxes running for a fortnight and collect anything late. Do not cancel the old hosting the same day you switch. Give it two weeks.
After the switch
Reissue the SSL certificate on the new host so the padlock keeps working. Most hosts do this automatically once the domain points at them, but check rather than assume.
Then walk the site as a visitor would: load a few pages, submit the contact form, place a test order if you sell anything, and send an email to and from the domain. Check that scheduled tasks still run. Leave the old account in place, unpaid but not deleted, for a couple of weeks.
When to let your host do it
If any part of the above made you uneasy, get the new host to do it. Migration is routine work for them and they have done it hundreds of times. Many will do it at no charge to win your business, which makes it the cheapest insurance available.
OzVPS moves web hosting customers across for free, including the site, the mail and the DNS, from cPanel, Plesk or DirectAdmin. Send your current host details through the client area and we will schedule it with you.
