Migrate WordPress to a New Server With No Downtime
Migrate WordPress to a new host with zero downtime: copy files and database, test on the new server via the hosts file before DNS, then switch and clean up.
Sleezr Team

Table of Contents
The key to a zero-downtime WordPress migration is to fully test the new server before you change DNS, using the hosts file to preview the site under its real domain. You copy everything to the new host, verify it locally with the live URL, and only then flip DNS. Visitors keep hitting the old server until the new one is proven good.
Migrate WordPress to a new server with no downtime
siteurl/home.203.0.113.50 example.com www.example.comWhy test with the hosts file (not the IP)
WordPress stores its address in the database, so browsing the new server by IP redirects back to the live domain, you would test the old site by mistake. The hosts file makes WordPress serve the new server under its true URL. Full walkthrough: test a WordPress site before DNS propagation.
Don’t forget
- Email / MX: web hosting and email are separate; confirm MX records.
- SSL: issue the certificate on the new server before go-live to avoid warnings.
- Caching/CDN: purge caches after the switch.
- wp-config.php: if
WP_HOME/WP_SITEURLare hard-coded there, keep them on the real domain, the hosts-file test covers the staging phase without changing them. - Search-replace: only if you intentionally change the domain, not needed for a same-domain move.
For the broader, CMS-agnostic version, see test a website before DNS migration.
Keep cutovers clean and repeatable
Hand-editing the hosts file for each migration invites mistakes: a typo in the IP, a missing www, or a temporary entry left behind that makes you "see the old site" for days. Sleezr stores migration entries in a dedicated environment you toggle on to test and off after go-live, flushing DNS automatically, so every WordPress move is clean and repeatable.
_Last tested: June 2026 on Windows, macOS and Linux._
Sources and further reading
- Official WordPress documentation
- How DNS works (Cloudflare Learning)
- The hosts file explained (Wikipedia)
Frequently Asked Questions
How do I migrate WordPress with no downtime?
Copy files and the database to the new server, test it there using the hosts file (mapping the real domain to the new IP) before changing DNS, then switch DNS once verified. Visitors never hit a broken site.
How do I test the new server before switching DNS?
Add a hosts entry pointing your domain to the new server IP, flush DNS, and browse the site. Only your machine sees the new server until you change DNS.
Should I lower the DNS TTL before migrating?
Yes. Lowering the TTL a day or two before the move shortens propagation time so the cutover is faster.
What about email during a WordPress migration?
Migrate or confirm MX records separately. Moving web hosting does not move email unless your MX records point to the same provider.
Related Articles
Test a WordPress Site Before DNS Propagation
Preview and test a WordPress site on a new server before DNS propagation using the hosts file. Map your real domain to the new IP, verify, then switch DNS safely.
Sleezr Team
Developer tools team
Fix WordPress Redirecting to the Live Site
WordPress redirects to the live site when testing on a new server because the URL is hard-coded in the database. Fix it with the hosts file, no DB edits needed.
Sleezr Team
Developer tools team
/etc/hosts Not Working? Fixes for Windows, Mac & Linux
The hosts file is ignored or /etc/hosts changes do not take effect? Fix it on Windows, Mac and Linux: flush DNS, check syntax, IPv6, line endings, resolver caches and save permissions.
Sleezr Team
Developer tools team
Fix DNS_PROBE_FINISHED_NXDOMAIN (2026)
Fix DNS_PROBE_FINISHED_NXDOMAIN in Chrome and Edge: flush DNS, check the hosts file, reset DNS servers and clear the browser cache. Step-by-step solutions.
Sleezr Team
Developer tools team
Which TLD to Use for Local Development (.test vs .localhost)
Which TLD to use for local development: prefer .test, avoid .dev and .local. Why .test is reserved, how to map it in the hosts file, and HTTPS tips.
Sleezr Team
Developer tools team