The most common way WordPress migrations cause downtime is switching DNS before confirming the new host actually works. Done in the right order, visitors keep hitting your old, working site the entire time you're setting up and testing the new one — they only get switched over once everything is confirmed working.
01Export the database
Via phpMyAdmin on your old host, or with WP-CLI if you have shell access:
wp db export backup.sql
02Copy all site files
Download the entire wp-content folder (themes, plugins, uploads) plus wp-config.php via SFTP, or use a plugin like Duplicator/All-in-One WP Migration if you don't have direct file access.
03Set up the new host — but don't touch DNS yet
- Create the database on the new host and import your
backup.sql. - Upload your site files.
- Update
wp-config.phpwith the new database name, username, password, and host.
04Test the new host using a hosts file override
This is the step that makes zero-downtime possible: point your own computer at the new server without changing DNS for anyone else.
- Windows: edit
C:\Windows\System32\drivers\etc\hosts - macOS/Linux: edit
/etc/hosts
Add a line: [new server IP] yourdomain.com. Save, flush your DNS cache (ipconfig /flushdns on Windows, sudo dscacheutil -flushcache on macOS), and visit your site. Only your computer sees the new server — everyone else still hits the old one, unaffected.
05Thoroughly test the new site while it's still hidden
Check every page template, contact forms, checkout flow if it's a store, image loading, and the admin dashboard. Fix anything broken now, while there's zero visitor impact.
06Lower your DNS TTL a day in advance
If you can, lower your DNS record's TTL (time-to-live) to 300 seconds a day before the actual switch. This makes the eventual real DNS change propagate in minutes instead of up to 48 hours.
07Switch DNS, then remove your hosts file override
Once you're confident, update your domain's A record to point at the new server. Remove the line you added to your hosts file — you want to see the site the same way real visitors now do, to confirm the live switch worked.