How to move your website to a new host without downtime
Published on 3 October 2026
You move a website without downtime by getting everything ready on the new host first and only switching the DNS afterwards. In short: lower the TTL a few days ahead, make a full backup, copy your files and database across, test the site in its new home and then change the IP address in your DNS. Only cancel your old hosting once everything has run smoothly for a few days.
What are you actually moving?
A website is made of more parts than you might think. List what needs to come along:
- Your files: for WordPress that’s the core, your theme, your plugins, your uploads and wp-config.php.
- Your database: with all your posts, pages, comments and settings.
- Your email: mailboxes on your domain and the MX records that decide where your mail goes.
- Your DNS: the records that say where your website and your mail live.
- Your domain name: the registration itself. It doesn’t have to move; you can simply point it at your new host.
Moving your hosting and transferring your domain are two separate jobs. Don’t do them at the same time, and you’ll know straight away where to look if something breaks.
Why lower the TTL first?
Every DNS record has a TTL: how long computers and providers hang on to the answer. If it’s set to a day, some visitors will keep landing on your old server for a day after you make the change. Cloudflare recommends lowering the TTL at least 24 to 48 hours before a migration, to 300 seconds for example. Then wait at least as long as the old TTL, so the old value has expired everywhere.
Step 1: make a full backup
Copy all your files and export your database. Keep them on your own computer, not just on the old server. WordPress is clear about it: you need both to be able to restore your site.
Step 2: set your site up on the new host
Upload your files to the new hosting, over SFTP for example. Create a new database with a user and import your database export. If the database name, user or password has changed, update DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in wp-config.php. If your domain stays the same, that’s all it takes according to WordPress’s own guide: copy the files and the database, and you’re done.
Changing your domain name as well? Then don’t run a find-and-replace on your database file in a text editor. Some themes and widgets store the length of your URL, and a plain replacement breaks that data. Use WP-CLI with wp search-replace, which handles that serialised data properly. Run it with --dry-run first to see what would change without saving anything.
Looking for a new home for your site? Web hosting at CakeHosting comes with SSD storage, databases, mailboxes and DDoS protection through RoyaleHosting, with more than 6 Tbps of capacity, and you can cancel any month. View the plans.
Step 3: test before anyone else sees it
You want to look at the site on the new server while the rest of the world still visits the old one. You do that with the hosts file on your own computer. Add a line with the new server’s IP address and your domain name, such as 203.0.113.10 yourdomain.com. On Windows the file lives at C:\Windows\System32\drivers\etc\hosts, on macOS and Linux at /etc/hosts. Your computer now goes to the new server, and nobody else’s does.
Click through your whole site: the homepage, a few posts, your contact form, logging in and, if you have one, the shopping basket. Remove the line afterwards, or you’ll be the only one stuck on the wrong server later.
Step 4: switch the DNS
When everything works, change your domain’s A record to the new server’s IP address. If you’re moving your DNS too, switch the nameservers instead. Thanks to the low TTL, most visitors will reach the new server within minutes. Don’t publish anything new during the switch, and don’t take orders that end up in the old database: whatever arrives there is missing on the new server.
Step 5: sort out HTTPS and email
Watch your SSL certificate. With the common HTTP-01 method, Let’s Encrypt checks that your domain points to the server. On the new server that only works after the DNS change, so expect a short moment without a valid certificate. Alternatively, request the certificate in advance with the DNS-01 method, if your host supports it. If you use email on your domain, move your mailboxes too and check the MX records. Plan that separately, so no mail gets lost.
Step 6: only then cancel
Keep your old hosting running for at least a few more days. That way you can go back if something’s missing, and the last visitors with an old DNS answer don’t land on an empty page. Check you really have everything: backups, mail and any scheduled tasks. Look at your notice period too, so you don’t pay for another year by accident.
Which mistakes are most common when moving?
- Switching the DNS before the new site has been tested.
- Forgetting the TTL, so visitors stay on the old server for hours.
- Moving the files but forgetting the database, or the other way round.
- Cancelling the old hosting on moving day.
- Transferring the domain and the hosting at once, so you can’t tell what’s causing a problem.
With a plan, moving a website is a bit like moving a cake to a new plate: with a steady hand, it stays in one piece. If you get stuck anywhere, send us a message.