Home › Blog › Article

Server Migration Checklist: Files, Database and Cutover Verification

Answer First: What To Do and How To Know It Worked

A safe WordPress server migration checklist is: clone files and database, rehearse the restore, freeze writes, sync the final delta, import with encoding intact, preview on the new server via a hosts file, switch DNS with a short TTL, then verify logs, carts, forms, cron, media and redirects. It is done right when the new origin serves the current content, no writes land on the old server after freeze, serialized options still render, TLS and HTTP status checks pass, and rollback takes minutes rather than hours. In 2026, target WordPress 6.8+, PHP 8.2 or 8.3, MySQL 8.0+/MariaDB 10.6+, and treat the migration as a release with an owner, timestamps and a documented abort trigger.

Step / Process: Migration Runbook Overview

  1. Inventory the site: WordPress version, PHP extensions, wp-config.php constants, multisite flags, object cache, cron mode, uploads size, table prefixes and external integrations.
  2. Build the destination, restore a rehearsal copy, and run automated checks behind a staging hostname.
  3. Announce the freeze window, stop writes, take final file and database snapshots, and sync the delta.
  4. Import the database safely, preserve serialized data, and run search-replace only with a serializer-aware tool.
  5. Preview via hosts file, execute functional and server-level verification, then lower DNS TTL and cut over.
  6. Monitor, keep the old origin warm, and roll back by reverting DNS or proxy routing if abort criteria are met.

For teams managing multiple client estates, our WordPress Site Migration runbook follows the same evidence-based sequence: every step has a command, an expected result and an owner. If the destination also changes PHP, review Upgrading to PHP 8.2/8.3: Fixing Dynamic Properties and Deprecations before the rehearsal restore, because a plugin fatal at preview time is cheaper than a fatal during cutover.

Pre-Migration Inventory and Rehearsal Restore

Why: Most failed moves are not transfer failures; they are environment mismatches discovered after DNS. You need a repeatable baseline before any freeze is scheduled.

Files to capture

  • Checkbox: Export the full document root, not only wp-content. Include hidden files such as .htaccess, .user.ini, nginx.conf snippets, favicon.ico, robots.txt, ads.txt and any mu-plugins. Run rsync -aHAX --numeric-ids -e 'ssh -p 22' /var/www/example.com/ user@new-ip:/var/www/example.com/ --exclude='wp-content/cache/' --exclude='wp-content/upgrade/'. Verify with rsync -anic --delete /var/www/example.com/ user@new-ip:/var/www/example.com/ | head -50; the item list should contain only intentional exclusions.
  • Checkbox: Record ownership and permissions. Use find /var/www/example.com -maxdepth 2 -printf '%u:%g %m %pn' | sort > /tmp/perms-before.txt, then repeat on the destination and diff it. Directories should be 755, files 644, and wp-config.php commonly 600 or 640 depending on the deploy user. A wrong group breaks uploads even when PHP-FPM can read the site.
  • Checkbox: Compare runtime versions. Capture php -v, php -m, mysql --version, nginx -v or apache2 -v, and wp core version --allow-root. As of 2026, WordPress 6.8+ on PHP 8.2/8.3 with mysqli, curl, mbstring, zip, gd/imagick, intl and opcache is a sane production baseline. Confirm WP_MEMORY_LIMIT, upload_max_filesize, post_max_size, max_execution_time and opcache.validate_timestamps match or exceed the source.
  • Checkbox: Rehearse the restore on a throwaway database. Import into example_rehearsal, point a temporary wp-config.php at it, and load the homepage plus /wp-admin/. Delete the rehearsal DB afterwards. This proves your dump is restorable, not merely downloadable.

Config and secrets

  • Checkbox: Diff wp-config.php deliberately. Keep DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, $table_prefix, WP_HOME, WP_SITEURL, WP_CONTENT_DIR, salts and WP_ENVIRONMENT_TYPE under review. Set define('WP_ENVIRONMENT_TYPE', 'staging'); only on the preview vhost, then return it to 'production' before DNS. Never copy a staging WP_HOME into the live config.
  • Checkbox: Inventory external write paths. List webhook endpoints, payment callbacks, SMTP credentials, object-cache drop-ins (wp-content/object-cache.php), advanced-cache.php, S3/Offload media buckets, Elasticsearch/Redis hosts and DISABLE_WP_CRON plus the system crontab. If DISABLE_WP_CRON is true, copy the cron entry: */5 * * * * www-data cd /var/www/example.com && wp cron event run --due-now --quiet.

Verify: store the inventory in the ticket and attach the dry-run diff. Pitfall: excluding wp-content/uploads because it is large, or forgetting a root-level verification file used by a CDN or payment provider. Rollback: at this stage rollback is trivial — discard the destination vhost and database; production has not changed.

Freeze Window Before Cutover

Get a Quote

Email + requirement + budget range — we reply with a quote within 24 hours.

Why: A freeze creates a single, knowable last-write timestamp. Without it, orders, comments, form entries, user registrations and scheduled posts can be silently split between two origins. The goal is not to take the site offline for hours; it is to make writes deterministic for 20–60 minutes.

Plan the window

  • Checkbox: Pick a low-write window and publish it. For WooCommerce, read wp wc report sales or query SELECT MAX(post_date_gmt) FROM wp_posts WHERE post_type='shop_order'; for several 2026 weeks and choose the quietest slot. Announce start/end in UTC, name the release owner, and define abort criteria: any 5xx above 0.5% for 5 minutes, checkout failure, or missing serialized options.
  • Checkbox: Lower DNS TTL ahead of time. 48 hours before the move, set A/AAAA/CNAME TTL to 300 seconds and confirm with dig +short example.com A and dig example.com A | grep -i 'INs*A'. If you are behind a proxy, lower the proxy’s routing TTL too. This is preparation, not the switch.
  • Checkbox: Stop or queue writes, do not just display a banner. Put WooCommerce in maintenance via wp maintenance-mode activate (WP-CLI 2.10+), disable public comment/form submission at the edge, pause external importers, and pause wp_cron on the old origin by commenting the system cron entry. Keep read traffic served from the old server with cached pages so customers see content, not a broken cart.
  • Checkbox: Drain, then snapshot. Wait for in-flight PHP-FPM requests: watch -n 2 'ps -eo pid,etime,cmd | grep php-fpm | grep -v grep'. Check DB activity with SHOW PROCESSLIST;. Then take the final dump and final rsync. Record the exact UTC timestamp and the last order/comment ID in the ticket.
  • Checkbox: Sync the delta, not the whole site again. Run rsync -aHAX --delete --numeric-ids /var/www/example.com/ user@new-ip:/var/www/example.com/ after the dump, then compare counts: find wp-content/uploads -type f | wc -l on both hosts. Re-run the SQL dump if any write appeared after the first one; never merge two dumps by hand.

Copy-pasteable freeze snapshot

# Run on the OLD origin during the approved 2026 freeze window
cd /var/www/example.com
wp maintenance-mode activate --allow-root
wp cron event list --due-now --allow-root > /tmp/due-events.txt

mysqldump --single-transaction --quick --default-character-set=utf8mb4 
  --routines --triggers --events --hex-blob 
  --set-gtid-purged=OFF -u dbuser -p example_db 
  | gzip > /tmp/example-final-2026.sql.gz

sha256sum /tmp/example-final-2026.sql.gz > /tmp/example-final.sha256
rsync -aHAX --delete --numeric-ids /var/www/example.com/ 
  user@new-ip:/var/www/example.com/
scp /tmp/example-final-2026.sql.gz /tmp/example-final.sha256 user@new-ip:/tmp/
ssh user@new-ip 'cd /tmp && sha256sum -c example-final.sha256'
wp core verify-checksums --allow-root

Verify: the checksum passes on the destination, wp maintenance-mode status reports active on the old origin, and a deliberate test comment/order is rejected rather than stored. Query the old DB 10 minutes later: SELECT COUNT(*) FROM wp_comments WHERE comment_date_gmt > '[freeze-utc]'; must return 0. Pitfall: relying on a visual banner while a payment webhook still writes to the old DB, or forgetting --single-transaction on InnoDB and capturing a half-finished order. Rollback: wp maintenance-mode deactivate, restore the crontab line, re-enable forms at the edge, and re-raise TTL later. No DNS has moved yet, so customers return to the old origin immediately.

DB Import and Serialized Data

Why: WordPress stores arrays and objects as serialized strings in wp_options, wp_postmeta, wp_usermeta and many plugin tables. A naive REPLACE() or plain text sed changes string lengths, corrupts the payload and produces blank widgets, lost menus or broken elementor/page-builder data. Import order and charset matter as much as the search-replace itself.

Import safely

  • Checkbox: Create an empty destination database with the right collation. Use CREATE DATABASE example_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; on MySQL 8.0+ or utf8mb4_unicode_ci on MariaDB 10.6+. Confirm the source with SELECT @@character_set_database, @@collation_database;. Mismatched utf8mb3/latin1 imports mangle emoji and accented product names.
  • Checkbox: Import with the same client charset and verify the dump first. Run gzip -t /tmp/example-final-2026.sql.gz, then zcat /tmp/example-final-2026.sql.gz | mysql --default-character-set=utf8mb4 -u dbuser -p example_db. For GTID-enabled sources keep --set-gtid-purged=OFF in the dump; for MySQL 8.0 with sql_require_primary_key disabled on the target, watch for plugin tables without keys and fix them upstream rather than disabling the guard permanently.
  • Checkbox: Compare structure and row counts. On both hosts run wp db query 'SHOW TABLES;' --allow-root and wp db size --tables --allow-root, then diff the outputs. Follow with wp db check --allow-root and wp core verify-checksums --allow-root. A missing custom table is usually a missed --routines/--triggers/--events flag or a dump taken from the wrong schema.
  • Checkbox: Run serializer-aware replacements only. WP-CLI 2.10+ with WordPress 6.8+ handles PHP serialized arrays and JSON safely: wp search-replace 'https://old.example' 'https://new.example' --all-tables --precise --recurse-objects --report-changed-only --dry-run --allow-root, inspect the report, then remove --dry-run. Use --skip-columns=guid unless the domain genuinely changes; see the WP-CLI search-replace documentation for column and table controls. If only the server IP changes and the domain stays, do not run any URL replacement at all.
  • Checkbox: Flush the right caches, in the right order. wp cache flush --allow-root, wp transient delete --all --allow-root, wp rewrite flush --hard --allow-root, then reload PHP-FPM (systemctl reload php8.3-fpm) to clear OPcache. If Redis is shared between old and new origins, use a distinct WP_CACHE_KEY_SALT or a separate Redis DB index during preview; otherwise the old site can serve new-origin transients.

Verify serialized integrity

# Detect broken serialization after import on the NEW origin
wp db query "SELECT option_id, option_name, LENGTH(option_value) 
  FROM wp_options WHERE option_value LIKE 'a:%' 
  AND option_value NOT REGEXP '^a:[0-9]+:\{' LIMIT 20;" --allow-root

wp option get active_plugins --format=json --allow-root
wp option get widget_text --format=json --allow-root 2>/dev/null || true
wp eval 'var_export(is_array(get_option("theme_mods_twentytwentysix")));' --allow-root
wp search-replace 'old.example' 'new.example' --all-tables --dry-run --report-changed-only --allow-root

Verify: active plugins, theme mods, nav menus, widget text and a known ACF/Elementor field render in /wp-admin/; the final dry-run reports 0 replacements for the old host. Check wp option get siteurl and wp option get home match the intended live URL. Pitfall: running UPDATE wp_options SET option_value = REPLACE(...) directly, importing into a non-empty schema so old rows survive, or replacing guid values and confusing feed consumers. Rollback: keep the gzipped dump and the pre-import schema snapshot; restore with DROP DATABASE example_db; CREATE DATABASE ...; then re-import the same file, or point wp-config.php back to the untouched old DB while DNS still resolves to the old origin. See WordPress database APIs when auditing custom plugin tables that store serialized payloads outside the core tables.

Preview via Hosts File

Why: DNS is a global lever; the hosts file is a local one. Previewing the real domain against the new IP lets you test TLS, cookies, absolute URLs, CORS, payment callbacks, CDN origin rules and Host-header vhost routing before any visitor is affected.

Set up the preview

  • Checkbox: Map only the production hostname on a test machine. Add 203.0.113.42 example.com www.example.com to /etc/hosts on Linux/macOS or C:WindowsSystem32driversetchosts on Windows, then flush: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder on macOS, ipconfig /flushdns on Windows, sudo systemd-resolve --flush-caches or resolvectl flush-caches on systemd Linux. Use a clean browser profile or incognito window so HSTS and cached DNS do not lie to you.
  • Checkbox: Confirm you are actually hitting the new origin. getent hosts example.com must return the new IP; curl -sSI --resolve example.com:443:203.0.113.42 https://example.com/ | head -20 should show HTTP/2 200, the expected server header and a unique response header you added temporarily, e.g. add_header X-Migration-Origin new-2026 always; in nginx. Remove that header before go-live.
  • Checkbox: Validate TLS without bypassing errors. Run openssl s_client -connect 203.0.113.42:443 -servername example.com </dev/null | openssl x509 -noout -dates -subject and confirm the cert covers example.com and www.example.com with a 2026 validity window. Do not accept curl -k as a pass. If the cert lives on the old box, copy the full chain and private key with mode 600, or reissue via ACME before preview.
  • Checkbox: Exercise write paths against the new DB. In the preview profile, submit a test contact form, add a product to cart, create a draft post, upload a 2 MB image, trigger wp cron event run --due-now, and log in/out. Then confirm those rows exist only in the new DB and delete the test artifacts. Check wp-content/uploads ownership after the upload: a www-data:www-data mismatch here is the classic post-migration 403.
  • Checkbox: Check redirects, canonical tags and mixed content. curl -sSI http://example.com/ should be 301 to HTTPS; curl -s https://example.com/ | grep -o '<link rel="canonical"[^>]*>' should contain the live domain. If the migration also changes the domain, align the redirect map with Changing Domains Without Losing Rankings: 301s, Search Console and Internal Links before preview sign-off, not after traffic moves.
  • Checkbox: Review logs during the preview. tail -f /var/log/nginx/example.com.error.log /var/log/php8.3-fpm.log while clicking the top 10 templates. Zero Allowed memory size exhausted, Uncaught Error, MySQL server has gone away and 404 on uploaded media is the acceptance bar.

Verify: a signed-off table in the ticket with hostname, resolved IP, TLS dates, HTTP status, test order/entry IDs and log excerpt. Pitfall: forgetting that a corporate VPN, DNS-over-HTTPS in Chrome/Firefox, or a CDN proxy can ignore /etc/hosts; test with curl --resolve as a second opinion. Another trap is leaving the hosts entry on the release laptop and later ‘seeing’ the new site while the public still sees the old one. Rollback: remove the hosts line, flush DNS, close the preview profile. If preview exposed a config defect, fix on the destination and re-run the same checks; production remains untouched on the old origin.

DNS Switch and Fallback

Why: DNS is the moment traffic changes, but propagation is not instantaneous and caches do not obey your maintenance plan. A controlled switch plus a warm fallback turns an uncertain internet-wide rollout into a reversible routing change.

Execute the cutover

  • Checkbox: Re-confirm freeze and final sync immediately before the switch. Re-run the row-count comparison and rsync -anic --delete. If any write appeared on the old origin after the freeze timestamp, repeat the dump/import cycle; do not ‘patch’ it with a manual SQL insert. Deactivate maintenance mode on the new origin only, and re-enable its system cron entry.
  • Checkbox: Change the record, not the whole zone. Update the A/AAAA record (or the CNAME/proxy origin) to 203.0.113.42 with TTL 300. Keep MX, TXT/SPF, DKIM, DMARC, CAA and verification TXT records untouched. Record the previous value verbatim in the ticket: dig example.com A +short > /tmp/dns-before.txt. If the site uses a CDN, change the origin/pool in the CDN dashboard and keep the proxy edge IP stable for an even faster fallback.
  • Checkbox: Watch authoritative answers and public resolvers. dig @ns1.yourdns.example example.com A +short, then compare dig @1.1.1.1 example.com A +short, dig @8.8.8.8 example.com A +short and dig @9.9.9.9 example.com A +short every 60 seconds. Expect a mixed window; that is normal. Use watch -n 60 'curl -sS -o /dev/null -w "%{remote_ip} %{http_code} %{time_total}n" https://example.com/' from an external monitoring host that has no hosts entry.
  • Checkbox: Keep the old origin warm for the fallback window. Leave the old vhost, DB, cert and cron paused but intact for at least 48 hours in 2026 (longer if any resolver still returns the old IP). Do not run wp maintenance-mode deactivate there until you are certain no writes can arrive; if a late webhook does arrive, export those rows deliberately and replay them on the new DB with matching IDs.
  • Checkbox: Monitor business signals, not just ping. For 60 minutes track 5xx rate, php8.3-fpm slow log, DB connections, checkout completion, form notifications, outbound SMTP, wp_mail failures, 404s on media, and wp cron event list --due-now. In Search Console and analytics, confirm the hostname did not silently change to the staging alias.
  • Checkbox: Raise TTL only after stability. After 24–48 clean hours, set TTL back to 3600 or your normal value, remove the temporary X-Migration-Origin header, purge CDN cache once, and archive the dump plus checksums according to your retention policy.

Fallback trigger and command

# Abort criteria met: revert routing to the OLD origin
# 1) Restore the exact prior record captured before cutover
dig example.com A +short > /tmp/dns-current.txt
# In your DNS provider: set A example.com -> 198.51.100.10, TTL 300

# 2) On the OLD origin, resume writes
wp maintenance-mode deactivate --allow-root
crontab -l | grep 'wp cron event run' || echo '*/5 * * * * www-data cd /var/www/example.com && wp cron event run --due-now --quiet'
systemctl reload php8.3-fpm

# 3) On the NEW origin, stop accepting writes during investigation
wp maintenance-mode activate --allow-root
tail -n 200 /var/log/nginx/example.com.error.log > /tmp/cutover-incident.log

# 4) Verify from a clean external resolver
dig @1.1.1.1 example.com A +short
curl -sS -o /dev/null -w '%{remote_ip} %{http_code}n' https://example.com/

Verify: the external monitor reports the new IP with 200, authoritative and public resolvers converge, and no new rows appear in the old DB after cutover. Pitfall: deleting the old server ‘to save cost’ on day one, editing MX by accident while changing A records, or assuming a 300-second TTL guarantees every recursive resolver obeys it. Some ISPs and mobile carriers clamp TTLs; hence the warm fallback. Rollback: revert the single record (or CDN origin pool), re-enable old-origin writes, freeze the new origin, and export any orders/entries created on the new DB during the incident before replaying them. Because the old DB was frozen rather than wiped, the replay is bounded and auditable. For broader release templates, see the technical column index.

Post-Cutover Verification Checklist

Why: A green DNS answer proves routing, not application health. This final pass catches the slow failures that appear only under real traffic and real integrations.

  • Checkbox: Core identity and content. wp option get home, wp option get siteurl, wp core version, wp plugin list --status=active and wp theme list --status=active on the new origin must match the inventory. Compare a checksum of three representative uploads: sha256sum wp-content/uploads/2026/03/hero.webp on both hosts.
  • Checkbox: HTTP matrix. Test /, a single post, a category archive, /wp-login.php, /wp-admin/, /wp-json/wp/v2/posts, /feed/, /sitemap_index.xml, a 404 and the 301 from HTTP. Expect 200/200/200/200/302-or-200/200/200/200/404/301 with no 502 or 524.
  • Checkbox: Writes and background jobs. Publish a draft, upload media, submit a form, complete a low-value test order in WooCommerce, then confirm email delivery and wp cron event list --due-now drains. Delete or refund the test artifacts and note their IDs.
  • Checkbox: Third parties. Confirm payment webhook delivery, SMTP/DKIM alignment, CDN purge, object-cache hit rate, search index sync, backup agent targeting the new path, and uptime monitor pointed at the new origin. Rotate any API allowlist that referenced the old IP.
  • Checkbox: Performance and errors. Compare TTFB from three regions against the pre-migration baseline, watch SHOW PROCESSLIST; for locked queries, and grep logs for Deprecated: under PHP 8.3. A migration that is ‘up’ but 3x slower still needs the old origin kept warm.

Frequently asked questions

Do I need search-replace if only the server IP changes?

No. If the domain, protocol and path stay identical, skip wp search-replace entirely. Only verify home/siteurl, flush caches and reload PHP-FPM. Running an unnecessary replacement is a common cause of corrupted serialized options.

How long should the freeze window be in 2026?

For a typical brochure site, 20–30 minutes is enough; for WooCommerce with webhooks and external feeds, plan 45–60 minutes. Size it from measured write volume, not from file size — rsync and mysqldump --single-transaction can run before the freeze, with only the delta inside it.

Can I keep both origins writing during DNS propagation?

No. Dual-write without replication guarantees split orders and duplicate IDs. Keep the old origin read-only or maintenance-mode, replay any late webhook rows manually, and rely on the warm fallback instead of trying to sync two live databases.

Final Action Checklist

  • Checkbox: Attach inventory, rehearsal diff, final dump checksum and freeze UTC timestamp to the release ticket.
  • Checkbox: Sign off hosts-file preview evidence: resolved IP, TLS dates, write tests and clean error logs.
  • Checkbox: Cut over one DNS record with TTL 300 and keep the old origin warm for 48 hours.
  • Checkbox: Complete the post-cutover HTTP, write, cron and third-party checks, then raise TTL and archive artifacts.

Need a second pair of hands on a high-traffic move? Our engineers run this checklist end to end, including rollback rehearsal. Review WordPress Site Migration or browse all services and book a 2026 cutover slot.

References & further reading

Need WordPress Development?

Free proposal and quote within 24 hours — we serve clients worldwide.

QQ