Step‑by‑Step Guide to Migrate a WordPress Site with Zero Downtime
Step‑by‑Step Guide to Migrate a WordPress Site with Zero Downtime
Moving a live WordPress site to a new host can feel risky—any misstep might cause broken links, lost traffic, or a complete outage. This guide walks you through a systematic migration that keeps your site online throughout the process, so visitors and search engines never notice the switch.
1. Prepare Your Current WordPress Site
1.1 Back up the database and files
Before touching anything, create a full backup. Export the MySQL database using mysqldump or a plugin like UpdraftPlus. Then download the entire wp‑content folder, wp‑config.php, and any custom files via SFTP. Store the backup in a secure location separate from your server.
Quick‑Tip: Compress the backup (tar.gz) before transferring; it reduces bandwidth usage and speeds up the copy.
1.2 Verify PHP and WordPress compatibility
Check the PHP version on your current host (php -v) and compare it with the requirements of your WordPress core, themes, and plugins. Note any extensions (e.g., gd, curl) that must be present on the destination server.
2. Choose a Destination Host
Pick a provider that offers optimized WordPress environments, automatic SSL, and reliable uptime. For a hassle‑free setup, you can rely on DevNix WordPress Hosting to provision a ready‑to‑run WordPress stack, complete with managed updates and built‑in caching.
3. Set Up the New Environment
3.1 Create a fresh database
Log into the new host’s control panel, create a MySQL database, user, and a strong password. Grant the user all privileges on the new database. Keep the credentials handy for the next step.
3.2 Install a clean WordPress core
Download the latest WordPress package from wordpress.org and unzip it into the web root of the new server. Open wp-config.php and fill in the new database details. At this point, WordPress will be ready to accept the imported data.
4. Transfer Files and Database
4.1 Export and import the database
On the old server, run:
mysqldump -u old_user -p old_database > site_backup.sql
Copy site_backup.sql to the new server and import it:
mysql -u new_user -p new_database < site_backup.sql
After import, run a search‑replace to update URLs from the old domain (or temporary staging domain) to the new one:
wp search-replace 'old-domain.com' 'new-domain.com' --skip-columns=guid
4.2 Sync wp‑content via rsync or FTP
Rsync is fast and preserves permissions:
rsync -avz -e ssh /path/to/old/wp-content/ user@newhost:/path/to/new/wp-content/
If you prefer a graphical client, simply upload the wp‑content folder using SFTP, overwriting the empty folder created by the fresh WordPress install.
Warning: Do NOT overwrite
wp-config.phpor the new.htaccessfile unless you have custom rules that must be preserved.
5. Update DNS with Minimal Downtime
5.1 Lower the TTL (Time‑to‑Live)
One day before migration, log into your DNS provider and set the TTL for the A record to a low value (e.g., 300 seconds). This ensures that when you switch the IP address, resolvers will refresh quickly.
5.2 Switch the A record to the new server
After confirming that the site works on the new host (you can test via a temporary subdomain or hosts file entry), update the A record to point to the new IP address. Because the TTL is low, most visitors will resolve the new address within a few minutes.
6. Verify and Clean Up
6.1 Test permalinks, media, and forms
Log into the WordPress admin on the new server, navigate to Settings → Permalinks, and click “Save Changes” to flush rewrite rules. Browse the front end, submit a contact form, and check that images load correctly.
6.2 Remove the old site
Once you’re confident the new installation is stable and traffic has fully migrated, delete the WordPress files and database from the old host. Keep the backup for at least a month in case something was missed.
Conclusion
By following this structured approach—backing up, provisioning a compatible environment, syncing data, and carefully managing DNS—you can move a WordPress site without any noticeable downtime. The result is a smoother user experience, preserved SEO rankings, and a fresh hosting platform ready for future growth.