How to Move Your Website to a New Host Without Downtime (Step by Step) · HostingVotes
Guides· 8 min read
How to Move Your Website to a New Host Without Downtime (Step by Step)
A four-day plan for switching web hosts with zero downtime: lower your DNS TTL, copy and test privately, sync, switch DNS and keep the old host running.
Most site migrations that go wrong fail for the same few reasons. The old hosting gets cancelled too early. Email breaks because nobody copied the DNS records. Or the switch happens before anyone tested the new server. All of these are avoidable.
The trick behind a zero-downtime move is simple: run both hosts at the same time and let DNS move visitors over gradually. Until a visitor's DNS cache expires they reach the old server, and after that they reach the new one. Both work, so nobody sees an error.
The four-day plan at a glance.
Before you start: an inventory
Ten minutes of note-taking now saves hours later. Write down:
Where your DNS is managed. It might be your registrar, your current host or a service like Cloudflare. This is where you'll make the switch.
Every DNS record you have. A, AAAA, CNAME, MX, TXT (SPF, DKIM, DMARC, verification records) and any SRV records. Export or screenshot the zone.
Where your email lives. If email is hosted with your current web host, you need a plan for it too. If it's with a separate provider like Google Workspace or Microsoft 365, just make sure the MX and TXT records survive the move.
Software versions. Your PHP version, database version and any extensions your site needs. Match or exceed them on the new host.
Cron jobs, redirects and server rules. Custom .htaccess rules, scheduled tasks and environment variables are easy to forget.
Compare hosts the community actually votes for
Real customers rank providers by speed, support and value — no paid placements.
TTL (time to live) tells DNS resolvers how long to cache your records. If your A record has a TTL of 86,400 seconds (24 hours), some visitors could keep going to the old server for a day after you switch.
At least 24–48 hours before the move, lower the TTL on the records you'll change (usually the A record for your root domain and the www record) to 300 seconds. Common migration guides recommend exactly this (Varidata, NameSilo). The wait matters: resolvers that cached your record under the old, long TTL need that long to expire before the new short TTL takes effect.
Step 2 (Day −1): Copy your site to the new host
Set up the new hosting account, then copy everything over.
For most PHP sites (including WordPress):
Copy the files. Use your control panel's backup or migration tool, SFTP, or rsync if you have SSH on both ends.
Export the database from the old host and import it on the new one.
Update the database credentials in your config file (for WordPress, wp-config.php) to match the new database.
If you have SSH access, the core of it looks like this:
# On the old server: export the database
mysqldump -u olduser -p old_database > site.sql
# Copy files and the dump to the new server
rsync -avz --progress ~/public_html/ newuser@NEW_SERVER_IP:~/public_html/
rsync -avz site.sql newuser@NEW_SERVER_IP:~/
# On the new server: import
mysql -u newuser -p new_database < site.sql
Because you're keeping the same domain, you don't need to search-and-replace URLs in the database. That's only necessary if the domain changes.
Email: if your mailboxes live on the old host, create the same mailboxes on the new host (or move email to a dedicated provider) before you switch the MX records. Then copy the old messages over with your mail client or an IMAP migration tool.
Step 3 (Day −1): Test privately with your hosts file
Here's the step most people skip, and the one that makes the move safe. Your computer's hosts file lets you point your domain at the new server for your machine only, while everyone else still sees the old one (SoftSys guide).
Add a line with the new server's IP address and your domain:
203.0.113.10 example.com www.example.com
Windows:C:\Windows\System32\drivers\etc\hosts (edit Notepad as administrator)
macOS and Linux:/etc/hosts (edit with sudo)
Then flush your DNS cache, or just restart the browser, and browse the site. You're now looking at the new host. Check:
The homepage and a handful of inner pages.
Logging in to your admin area.
Forms, search and checkout if you have them.
Images and downloads (missing files show up here).
Your server's error log for warnings.
About SSL: the new host may not be able to issue a free certificate for your domain until DNS points at it, because the common validation method checks the live domain. Many hosts give you a temporary certificate or issue the real one automatically right after the switch. Ask your new host how they handle it, so you know whether to expect a brief certificate warning (and how to avoid one).
Remove the hosts-file line when you're done testing.
Step 4 (Switch day): Freeze, sync, switch
Choose a quiet time for your site, like a weekday night in your main audience's time zone.
Freeze changes. Pause publishing, and if you run a store, consider a short maintenance message or stopping orders for the sync window. Anything written to the old database after this point would be lost.
Do a final sync. Export the database again and import it on the new server, and re-sync any uploaded files that changed.
Update DNS. Change the A record (and www CNAME or A record) to the new server. Update MX records only if email is moving too.
Verify from outside. Use an online DNS checker to watch the new IP spread, and load the site from your phone on mobile data, which won't share your computer's DNS cache.
With a 300-second TTL, most visitors move within minutes. A few resolvers ignore low TTLs and cache longer, which is exactly why the old host stays on.
Step 5 (+2 days or more): Keep the old host running
Don't cancel the old plan the moment the site works. Keep it for at least 24–48 hours, and longer if you can. Cancelling too early is one of the most common causes of migration downtime (NameSilo). During that time:
Watch the old server's access log. When real traffic there drops to nothing, the move is done.
Check the old mailboxes for stray messages if email moved.
Make sure scheduled tasks and backups are running on the new server.
Once everything is quiet, raise your DNS TTL back to a normal value (an hour or more), take one last full backup from the old host for safekeeping, and then cancel it.
Migration checklist
Stage
Task
Done when
Prep
Export DNS zone, list software versions, cron jobs, mailboxes
You have a written inventory
Day −2
Lower TTL to 300 s on records you'll change
New TTL visible in a DNS lookup
Day −1
Copy files and database, create mailboxes
Site loads on the new server
Day −1
Test via hosts file
Logins, forms and media all work
Switch
Freeze, final sync, update DNS
New IP showing in DNS checkers
+2 days
Watch old server logs, then raise TTL and cancel
No traffic left on the old host
Common mistakes to avoid
Forgetting TXT records. Losing SPF, DKIM or DMARC records can send your email straight to spam. Copy every record, not just the A record.
Switching nameservers instead of records. Moving DNS to the new host's nameservers is a bigger change than updating one A record. If you do it, recreate every record in the new zone first.
Mismatched PHP versions. A site that ran on an old PHP version can break on a new one. Test, and fix plugin or theme errors before the switch.
Ignoring the new host's limits. If the new plan has lower resource limits, a busy site can hit them on day one. Check them in advance; our hosting checklist covers what to ask.
Frequently asked questions
How long does it take to move a website to a new host?
The hands-on work for a typical small site is a few hours. The full plan spans about four days because you lower the TTL in advance and keep the old host running afterwards. Most of that time is waiting, not working.
Will moving hosts hurt my SEO?
Not if the domain and URLs stay the same and the site stays up. Search engines just see the same pages served from a new IP address. Problems come from downtime, broken pages or changed URLs, which this process avoids.
Should I use my new host's free migration service?
Often, yes. Many hosts migrate sites for free, and it saves time. Still lower your TTL, test via the hosts file and keep the old host running, because the switch itself is still your responsibility.
What if something goes wrong after the switch?
Because the old server still has a working copy, rolling back is easy: point the DNS records back to the old IP. With a 300-second TTL, most visitors are back on the old server within minutes.
Shopping for the new host? See which providers real customers vote highest, and compare VPS and web hosting plans before you move.