How to Migrate a WordPress Website

Move the complete website while preserving data, serialized values, URLs and a rollback path.

2 min read

  • Article
  • Intermediate
  • 2 minutes read
  • Reviewed August 4, 2026
  • WordPress maintenance and troubleshooting

A WordPress migration moves a website between servers, environments or architectures.

The migration can preserve the same public URL or also change domain, protocol or directory structure.

Define the Scope

Record whether the project changes:

  • Hosting.
  • PHP or database version.
  • Domain.
  • protocol.
  • directory path.
  • CDN.
  • email transport.
  • object cache.
  • external storage.
  • scheduled jobs.
  • DNS.
  • multisite structure.

Inventory the Source

Capture:

  • Files.
  • database.
  • WordPress, theme and plugin versions.
  • environment constants.
  • rewrite rules.
  • cron events.
  • licences.
  • integrations.
  • DNS records.
  • certificates.
  • storage and media paths.
  • redirects.
  • monitoring.

Prepare the Destination

Match supported runtime requirements and create the database, credentials, storage, TLS and server configuration.

Test with a staging hostname or local hosts-file override where possible.

Transfer Files and Database

Copy a consistent backup set.

Update wp-config.php for destination credentials and environment values.

When URLs or paths change, use a serialization-aware tool. WP-CLI search-replace handles PHP serialized data and supports --dry-run.

Cutover

  1. Reduce DNS TTL in advance when appropriate.
  2. pause high-write operations if required.
  3. create a final backup.
  4. synchronize recent files and database.
  5. switch DNS or routing.
  6. clear caches.
  7. verify the destination.
  8. monitor both old and new infrastructure.

Verification

Test frontend, login, forms, email, search, media, scheduled tasks, APIs, payments, redirects and canonical URLs.

Keep the source available but protected until rollback risk is acceptable.

Frequently Asked Questions

Can I copy only the database?

Not for a complete migration. Themes, plugins, uploads and configuration also matter.

Can a text editor replace the domain in an SQL file?

A naive replacement can damage serialized data. Use a serialization-aware migration process.

Continue Learning

Previous: Troubleshooting WordPress Email Problems

Next: Changing a WordPress Domain Safely