Step-by-Step Guide to Migrating a WordPress Site to a New Host with Zero Downtime
Learn how to migrate WordPress to a new host with staging, wp-cli search-replace, SSL, DNS cutover, and rollback planning.
Migrating a WordPress site to a new host sounds simple until you have to protect rankings, preserve orders and form submissions, and avoid that ugly window where visitors see broken pages or stale content. For developers, sysadmins, and small technical teams, a successful move is less about “copy files and pray” and more about building a controlled cutover plan. This guide walks through a production-grade migration workflow: staging validation, database export/import, wp-cli search-replace, SSL handling, DNS cutover strategies, and rollback planning. If you need a broader process mindset for migrations, see when to leave a monolith and the operational thinking in simplify your shop’s tech stack.
1) Define the migration goal and freeze the moving parts
Inventory what can break during the move
Before you touch a server, list every system component the site depends on: WordPress core, theme, plugins, object cache, CDN, email delivery, cron jobs, payment gateways, and any custom integrations. A site that “just runs on WordPress” often also depends on external services for SMTP, analytics, identity, search, and media offload. Treat the migration like an application release, not a hosting swap. For documentation hygiene, it helps to adopt the discipline described in rewrite technical docs for AI and humans so your runbook stays useful after this project is over.
Choose a low-risk migration window
Zero downtime does not mean zero coordination; it means you control when writes happen and when DNS begins pointing elsewhere. Pick a window where traffic is relatively predictable, then plan the cutover when your team can watch logs and respond quickly. If your site supports user-generated content, ecommerce, or membership signups, you must decide whether to temporarily pause writes or replicate them carefully during the final sync. A carefully managed window is the difference between a clean cutover and a support ticket pileup.
Set success criteria upfront
Define what “done” means before the migration begins. Typical success criteria include: homepage and key templates render correctly, forms submit, login works, permalinks resolve, media loads from the expected origin, SSL is valid, and search indexes are intact. If you run a commercial site, add conversion-critical checks such as checkout, subscriptions, and transactional email. For broader resilience thinking, the approach pairs well with keeping your sealed records safe amidst widespread outages, because both require preplanned fallback behavior.
2) Build a staging environment that mirrors production
Duplicate the runtime as closely as possible
Staging should match production as closely as budget allows: PHP version, web server, database version, caching layer, and file permissions. Inconsistent environments are the most common reason a migration looks good on staging and fails after cutover. Replicate constants like memory limits and upload size restrictions because they can affect media-heavy or plugin-rich sites. If your stack uses a container or managed environment, document it clearly the same way you would a live-service workflow in topic cluster map planning or cloud data architecture decisions.
Clone files and database safely
Copy the WordPress filesystem, including wp-content, and restore the database to the staging host. Use rsync for files and a compressed SQL dump for the database if possible. Avoid modifying production content directly during this step, because a clean snapshot is your rollback anchor. If the site is large, verify that the staging copy renders from a temporary domain or hosts file override before you proceed.
Verify plugins, themes, and caching behavior
Once staging is live, inspect plugin compatibility and remove anything stale or no longer needed. Security, caching, SEO, and redirection plugins often create hidden dependencies that only show up during migrations. Test cache purge behavior, login flows, REST API endpoints, and media delivery. The same operational rigor used in client experience operations applies here: small invisible failures have outsized business impact.
3) Prepare backups and a rollback plan before touching DNS
Take multiple backup types
At minimum, capture a full database dump and a full filesystem backup. For important production sites, take a second backup stored off-host, and confirm it can actually be restored. If your host supports snapshots, use them—but never treat a snapshot as the only safety net. Strong backup practice is consistent with the approach in emergency access and service outages, where the key is having a reliable alternate path when the primary one fails.
Write a rollback decision tree
Rollback should not be a vague idea; it should be a decision tree with trigger points. For example: if login fails, revert DNS and restore the previous database snapshot; if images 404 after 15 minutes, disable CDN origin rewrite and recheck file paths; if checkout errors appear, pause traffic and reinstate the old host. Make sure the team knows who approves rollback and who executes it. A rollback that requires group debate is not a rollback plan.
Protect against “silent failure”
Some migration failures don’t create obvious errors. Search indexes may lag, image sizes may break, and cached pages may still serve old host references. Add monitoring for HTTP status codes, PHP errors, form submissions, order creation, and uptime from multiple regions. This is where operational playbooks matter; the mindset is similar to the disciplined contingency approach in market intelligence subscriptions and covering market shocks: know what signal means real trouble before you react.
4) Export the database cleanly and prepare the new host
Export the database from production
Use a consistent export method. If you have shell access, mysqldump is straightforward; in managed hosting environments, phpMyAdmin or host tools may be the only option. Example:
mysqldump -u dbuser -p --single-transaction --quick --hex-blob wordpress_db > wordpress_db.sqlUse --single-transaction for InnoDB tables to reduce lock risk, and verify the dump contains all tables. For larger sites, compress the export to reduce transfer time. This step is your safety-critical baseline because every later correction depends on the data being complete.
Provision the target environment
On the new host, create the database, user, and permissions before importing anything. Confirm PHP extensions, object cache support, and file ownership conventions. If the site uses wp-config.php environment constants, prepare them now so the imported database lands in a ready environment. For teams building repeatable hosting procedures, the operational thinking aligns with low-stress automation and tools and structured onboarding—the fewer surprises, the better.
Import and validate schema integrity
Import the SQL dump into the new database and run a quick sanity check: table count, row counts for high-value tables, and an admin login test after file placement. If the site has custom tables, inspect them for collation mismatches or size constraints. Database migration problems often hide in character sets, especially when moving between older and newer MySQL/MariaDB versions. Confirm that the site can connect before attempting any URL replacements.
5) Migrate files and media without breaking paths
Copy the WordPress filesystem
Use rsync or an equivalent incremental copy tool to move WordPress files. This is especially important for sites with large uploads directories or many generated thumbnails. Example:
rsync -avz --progress /var/www/html/ user@newhost:/var/www/html/Exclude cache directories, backup archives, and transient files unless you intentionally need them. Bringing over old cache artifacts can create confusing behavior after the cutover. If your deployment process is usually manual, this is a good time to document it in a more durable way, following the principles in clustered documentation and documentation reuse.
Check file ownership and permissions
Permissions problems are a classic migration failure. Make sure the web server user can read theme and plugin files and write to upload and cache directories if needed. Avoid world-writable permissions unless the hosting model absolutely requires them. After the copy, test uploads from the WordPress admin and confirm generated media are stored correctly.
Consider offloaded media and CDN dependencies
If media is offloaded to S3, a CDN, or another object store, the migration may not need a full media transfer, but it still needs consistent configuration. Ensure the new host has access keys, bucket policies, and rewrite rules set correctly. If a CDN is in front of the site, remember that CDN caching can mask origin issues during testing. For a broader operational analogy, think of this like the layered risk management described in backup access planning and outage resilience: the site may appear fine until a missing layer is actually exercised.
6) Use wp-cli search-replace to fix URLs, serialized data, and host references
Why wp-cli beats manual SQL edits
For most WordPress migrations, wp-cli search-replace is the safest tool for replacing old domain references with the new host’s URL. Manual SQL replacements are risky because WordPress stores serialized arrays in many plugin settings, and a naive string replace can corrupt them. The CLI tool understands serialized data and reduces the chance of subtle breakage. Example:
wp search-replace 'https://oldsite.com' 'https://newsite.com' --skip-columns=guid --all-tablesAlways test on staging first, and review the output carefully. The command can touch a lot of rows, which is exactly what you want when migrating a live site—but only if you’ve validated the result. This is the same principle you’d apply when tuning a content system or operational workflow in migration playbooks and DevOps simplification.
Run a dry run before committing
Use --dry-run to see what would change before you make any edits. That gives you a change count and helps reveal unexpected references, such as hardcoded CDN URLs, API callbacks, or plugin metadata. Example:
wp search-replace 'https://oldsite.com' 'https://newsite.com' --skip-columns=guid --all-tables --dry-runIf the dry run surfaces thousands of replacements in a plugin table you don’t understand, pause and inspect. A little skepticism here prevents painful debugging later.
Account for search engines, GUIDs, and mixed content
Do not replace guid values unless you have a specific reason. GUIDs are identifiers, not page URLs, and changing them can create unnecessary complications in feeds and syndication. After the migration, inspect mixed-content warnings in the browser console and replace stray http references if your new host or SSL setup exposes them. For technical teams who need to standardize this work, the patterns resemble the careful process design seen in bottleneck elimination and structured search planning.
7) Handle SSL correctly on the new host
Issue or migrate certificates before the cutover
SSL is one of the first things that can break user trust after a host move. Install or provision the certificate on the new host before DNS points there so the site can answer HTTPS requests immediately. If you use Let’s Encrypt, verify that validation can complete on the new server and that auto-renewal is configured. If the old host has an active certificate and the new one does not, users may hit certificate warnings even if the site content is otherwise correct.
Watch for full-chain and redirect issues
After installation, verify that the full certificate chain is being served and that HTTP-to-HTTPS redirects are functioning once. Double redirects are common after migrations, especially if both the host and WordPress are configured to force HTTPS. Confirm that canonical tags, sitemap URLs, and internal links resolve to the secure version. This is a good place to think like the operators behind enterprise security response: what seems like a minor configuration detail can become a user-facing outage.
Test TLS from multiple viewpoints
Do not trust a single browser test. Check the certificate from the command line, from an incognito browser, and from a mobile device on a different network. If you run a CDN, test both origin and edge behavior. SSL bugs often appear only after cache expiration or when a non-primary server handles traffic.
8) Plan DNS cutover to minimize user impact
Lower TTL in advance
One of the simplest zero-downtime tactics is lowering the DNS TTL 24–48 hours before the move. A lower TTL helps resolvers pick up the new IP faster when you flip records, though behavior still depends on caching intermediaries you don’t control. You should also verify which records need updating: apex A/AAAA, www CNAME, mail-related records, and any subdomains used by logins or APIs. For DNS-heavy workflows, the situation resembles the planning discipline in seasonal route planning and supply chain contingency planning: timing and dependencies matter more than the nominal change itself.
Use a staged cutover strategy
If possible, validate the new host via a temporary hostname or hosts-file override before changing live DNS. Then switch the primary A or CNAME record, keep the old host online temporarily, and monitor traffic patterns. This gives you a buffer if some clients resolve the old record slowly. For high-traffic or revenue-critical sites, you can also use a blue-green approach, where the old environment remains available until confidence is high enough to retire it.
Monitor propagation and serve both environments briefly
During propagation, some users will land on the old host while others reach the new one. Keep both environments able to serve the site for a short period, but prevent destructive divergence by freezing content writes or syncing one-way from old to new if needed. Monitor access logs, application logs, and error rates on both hosts. The best migration operators treat this like a live incident response window rather than a background admin task.
9) Run validation checks after the switch
Check the homepage and critical journeys
Immediately after DNS cutover, test the homepage, category pages, login, contact forms, search, checkout, and any custom post types. Do not stop at visual inspection; verify that forms produce submissions and that confirmation emails are delivered. If the site has membership or ecommerce features, test authenticated and unauthenticated behavior separately. This type of functional validation is consistent with the practical mindset in client experience operations and bottleneck monitoring.
Inspect logs and performance
Watch for 500s, 404s, PHP warnings, slow queries, and database connection errors. Compare response time and memory usage between the old and new environments to catch capacity mismatches. If the new host is faster on paper but slower in practice, caching or PHP tuning may be the culprit. A migration is successful only if the site performs at least as well as before.
Rebuild caches and resubmit sitemaps
Purge page caches, object caches, and CDN caches after the cutover. Regenerate permalinks if necessary and resubmit XML sitemaps in Search Console or equivalent tooling. Search engines may take time to fully reprocess the new origin, so leaving stale cache artifacts in place can create contradictory signals. For ongoing maintenance, the same careful system updates discussed in documentation strategy will help your team keep post-migration procedures accurate.
10) Use a comparison table to choose the safest migration path
| Method | Best for | Risk level | Downtime risk | Notes |
|---|---|---|---|---|
| Manual file copy + SQL import | Small sites with simple stacks | Medium | Low if planned well | Works, but easy to miss serialized data and permissions issues. |
| Managed host migration tool | Teams using supported hosts | Low | Very low | Fastest path if the host’s migration system is reliable. |
| Staging clone + DNS cutover | Most business sites | Low | Very low | Recommended baseline for controlled launches. |
| Blue-green environment | Revenue-critical or high-traffic sites | Low | Minimal | Two live environments reduce risk but increase cost. |
| Maintenance-mode migration | Low-traffic blogs or internal sites | Low | Moderate | Simpler, but not zero downtime and can interrupt users. |
11) Pro tips, edge cases, and common failure modes
Pro Tip: The most reliable zero-downtime migrations are boring. They succeed because the team rehearsed the cutover on staging, documented the rollback triggers, and left nothing to interpret at 2 a.m.
Watch for serialized option data and plugin-specific URLs
Some plugins store URLs in nested arrays or custom tables that may not be obvious during testing. After wp-cli search-replace, inspect plugin settings pages, media URLs, and custom fields to ensure nothing references the old host. If a plugin caches an origin URL internally, you may need to clear its settings or re-save them. This is where a migration can look complete while still failing in subtle, user-visible ways.
Don’t forget cron, email, and third-party callbacks
Scheduled jobs, contact forms, password resets, and webhook callbacks are common migration casualties. Confirm that wp-cron or server cron is running on the new host, SMTP credentials are valid, and any hardcoded callback URLs have been updated. If you run tracking or fulfillment integrations, validate them end to end rather than assuming they survived the move.
Keep the old host online briefly, then retire it cleanly
Retain the old environment for a short post-cutover observation period, usually 24 to 72 hours depending on your risk tolerance and traffic profile. Once you’re confident the new site is stable, archive the old host securely and remove any credentials or firewall openings you no longer need. This makes rollback possible while avoiding long-term drift between environments. The same logic underpins good operational retirement planning in resilience planning and emergency access design.
12) Final checklist for a zero-downtime WordPress migration
Pre-cutover checklist
Confirm staging mirrors production, backups are restorable, database exports are current, TTLs are lowered, SSL is ready, and the rollback decision tree is written. Verify who is responsible for the DNS update, log monitoring, and business-side validation. If your team lacks a consistent migration template, borrow the same operating cadence used in automation playbooks and repeatable training rubrics.
Cutover checklist
Switch DNS, monitor propagation, test the main journeys, watch logs, and validate SSL. Keep the old host live until you’re confident that traffic is stable and no hidden dependency is failing. If anything serious breaks, execute rollback immediately rather than trying to debug in place under live traffic.
Post-cutover checklist
Rebuild caches, verify sitemaps, resubmit search engine URLs if needed, check email deliverability, and document what changed. Then update your internal runbook so the next migration is faster and safer. A one-off success is good; a repeatable migration pattern is what scales across teams and projects.
FAQ: WordPress Zero-Downtime Migration
1) Can WordPress really be moved with zero downtime?
Yes, if you stage the new host, keep the old host available during DNS propagation, and control content writes during the cutover window. Zero downtime is most realistic when the site is mostly read-heavy or when you can briefly freeze changes. For active ecommerce or membership sites, you may need additional syncing or a short write freeze to prevent lost transactions.
2) Why is wp-cli better than search-and-replace in SQL?
Because WordPress data often contains serialized values. A raw SQL replace can corrupt those values and break plugin settings or theme options. wp-cli search-replace understands serialized data and is designed for WordPress migrations.
3) Should I change the GUIDs in the database?
Usually no. GUIDs are identifiers used in feeds and syndication, not page URLs. Changing them is unnecessary in most migrations and can create compatibility issues.
4) How long should I keep the old host active?
At least until DNS propagation has settled and you have confidence that all critical functions work on the new host. In many cases, 24 to 72 hours is a practical observation period, but high-risk sites may keep the old environment longer as a rollback safety net.
5) What is the most common cause of post-migration problems?
Unexpected host references buried in plugin settings, media paths, caches, or callback URLs. The next most common issues are SSL misconfiguration, missing PHP extensions, and permission problems on uploaded files.
6) Do I need to lower DNS TTL if I’m using a managed migration tool?
It still helps. Managed tools can move the site data, but DNS still determines when users reach the new host. Lowering TTL reduces propagation delay and gives you more control over the cutover.
Conclusion: treat the migration like a controlled release
A zero-downtime WordPress migration is not magic; it is the result of sequencing, validation, and rollback discipline. If you prepare the staging environment, export and import the database cleanly, use wp-cli search-replace correctly, install SSL before the cutover, and manage DNS with a realistic rollback plan, you can move hosts with minimal user impact. The real goal is not simply to make the site work on a new server—it is to make the transition invisible to visitors and calm for the team. For a stronger long-term documentation habit, revisit technical docs for AI and humans, and if your migration is part of a larger platform shift, compare it with broader patterns in migration playbooks and tech stack simplification.
Related Reading
- When to Leave a Monolith: A Migration Playbook for Publishers Moving Off Salesforce Marketing Cloud - Useful for planning multi-system cutovers with fewer surprises.
- Simplify Your Shop’s Tech Stack: Lessons from a Bank’s DevOps Move - Shows how to reduce operational complexity before a migration.
- Rewrite Technical Docs for AI and Humans: A Strategy for Long‑Term Knowledge Retention - Helps turn this migration into a durable internal runbook.
- Keeping Your Sealed Records Safe Amidst Widespread Outages - Strong reference for backup and continuity planning.
- Emergency Access and Service Outages: How to Build a Travel Credential Backup Plan - A good analogy for creating dependable fallback access paths.
Related Topics
Daniel Mercer
Senior Technical Editor
Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.
Up Next
More stories handpicked for you