Migrating a WordPress site can be nerve-wracking. Whether you’re moving to a new host, changing domains, or migrating from staging to production, the process involves moving files, transferring a database, updating URLs, and switching DNS — any of which can go wrong if not handled carefully.
This guide covers a reliable WordPress migration process that minimizes downtime and risk, whether you’re moving a small blog or a complex WooCommerce store.
Pre-Migration Checklist
Before starting the migration, complete this checklist. Take a full backup of your files and database. Note your current WordPress version, PHP version, and any server-specific configurations. List all active plugins and their versions. Document custom configuration values in wp-config.php. Check if your new host meets WordPress’s minimum requirements.
Notify stakeholders about the planned migration window. Plan for 2-4 hours of potential downtime, though the actual cutover should take under 30 minutes with proper preparation. Schedule the migration during low-traffic hours.
Migrating Files
Transfer your WordPress files using rsync for efficiency, or use an FTP client for smaller sites. Rsync transfers only changed files, making it ideal for large sites with frequent updates. Exclude the wp-content/cache directory and any temporary files. If possible, compress your files into a single archive before transfer to speed up the process.
For managed WordPress hosts, use their migration plugin or tool — most major hosts provide automated migration solutions that handle file transfer, database migration, and URL replacement automatically.
Migrating the Database
Export your WordPress database using phpMyAdmin, WP-CLI, or a plugin like WP Migrate DB. Use mysqldump for large databases — it’s faster and more reliable than phpMyAdmin for databases over 100MB. Import the database on your new server the same way.
After importing, update the site URL and home URL in the wp_options table. If the domain changed, search and replace all instances of the old domain in the database. Use WP-CLI’s search-replace command or the Better Search Replace plugin for this. Never use a simple text editor for search-replace on a database dump — serialized data requires special handling.
DNS Cutover
When you’re confident the new site is working correctly, update your DNS records to point to the new server. Change the A record for your domain to the new server’s IP address. If you changed nameservers, update them at your domain registrar — this can take 24-48 hours to propagate fully.
Set the TTL (Time to Live) low — 300 seconds — a few days before the migration so DNS changes propagate quickly during cutover. After the migration is complete and stable, increase the TTL back to 3600 or higher for performance.
Post-Migration Checks
After the migration, verify everything works. Test frontend pages load correctly. Test admin login and functionality. Check that forms, search, and comments work. Verify that permalinks are working and rewrite rules are correct. Test WooCommerce checkout or membership registration. Check email delivery.
Run a crawler like Screaming Frog to identify broken links. Check Google Search Console for crawl errors. Set up redirects from any changed URLs. Monitor error logs for the first 48 hours. Keep the old server running for at least a week in case you need to roll back.
The Bottom Line
A successful WordPress migration is about preparation, testing, and having a rollback plan. Take backups before you start, test thoroughly at every stage, and never delete the old server until you’re confident the new setup is stable. With the right process, even complex migrations can be completed with minimal downtime and zero data loss.
