Sleezr
Buy Sleezr
WordPressmigrationhostinghosts fileDNS

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.

S

Sleezr Team

·3 min read
Migrate WordPress to a New Server With No Downtime

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

1
Lower your DNS TTL (e.g. to 300s) a day or two before the move.
2
Copy files to the new server (SFTP, rsync, or a migration plugin).
3
Export and import the database, keeping the same domain in siteurl/home.
4
Map the domain to the new server in your hosts file:
TEXT
203.0.113.50 example.com www.example.com
5
Flush DNS, on Mac or on Windows.
6
Test thoroughly on the new server with the real domain: pages, login, forms, checkout, media, plugins.
7
Switch DNS at your registrar to the new server IP.
8
Remove the hosts entry and flush DNS so you follow real propagation.

Why 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_SITEURL are 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

Also readTest a WordPress site before DNS propagation
Also readFix WordPress redirecting to the live site
Share this article

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

3 min read
WordPressDNSmigration

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.

S

Sleezr Team

Developer tools team

3 min read
WordPressredirectmigration

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.

S

Sleezr Team

Developer tools team

4 min read
hosts filetroubleshootingDNS

/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.

S

Sleezr Team

Developer tools team

3 min read
DNSChrometroubleshooting

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.

S

Sleezr Team

Developer tools team