Separate a host move from an address change
Moving the same domain to a new host is different from changing the domain, scheme or installation path. Write the exact change first. Do not run a broad replacement simply because files were copied. Inventory WordPress address settings, content links and any plugin-managed URLs that are actually affected.
WordPress's migration handbook describes procedures that vary by migration type. Use the section matching your installation, and keep multisite or unusual directory arrangements separate from a simple single-site example. WP-CLI separately documents serialization-aware replacement, which matters when stored settings contain structured PHP data. [1] [2]
Protect a copy and define the replacement boundary
Create a restorable database backup and an isolated working copy before experimenting. Confirm the site's path and database identity through your normal administration controls. A command run from the wrong installation can produce a perfectly valid report about the wrong database. Record those identities without putting credentials in the worksheet.
List the exact old and new strings, including scheme and path, plus the intended table and column scope. Ask why each table belongs in the change. Logs, archived records and other applications sharing a database may have different requirements. Avoid a whole-database wildcard as a substitute for understanding ownership.
Use a dry run that understands stored data
WP-CLI documents that search-replace handles PHP serialized data and offers a dry-run option that reports without saving changes. It also documents table selection, multisite behavior and column exclusions. Review those options for the installed command rather than pasting a mutation command from a generic tutorial. [2]
Have the operator run the dry run against the isolated copy with the agreed scope and retain the report. A replacement count is not yet an acceptance result: inspect which tables and values account for it. If the count is unexpectedly zero or much larger than expected, stop and resolve the mismatch before executing a write.
Worked example: a longer domain in stored settings
In an invented migration, a site moves from https://old.example to https://new-publication.example. One plugin stores a URL inside serialized settings, while an article contains an ordinary link. A raw text substitution that ignores the serialized representation is not the proposed procedure. Use the documented serialization-aware path and inspect both records afterward.
Suppose the dry run reports twelve candidate replacements, but the migration inventory expected eleven. The extra result might be legitimate or might be an archived reference intended to remain historical. The acceptance step is to explain it, not adjust the expected number until the report looks correct. These counts are fictional, not observed WP-CLI output.
Check the result beyond the command report
On the changed copy, inspect the home page, an affected article, a media asset and the plugin feature containing the stored setting. Compare resulting URLs against the intended domain and check for redirects back to the old address. Preserve the posts' GUID values: the WordPress handbook explicitly says not to change them during this move, and WP-CLI supports column exclusions. Not every old-looking string should change. [1] [2]
Record each observation and the restore reference in the worksheet. Only then prepare the scoped production change and its rollback decision. This is a research rehearsal plan, not a command execution report or proof of plugin compatibility. If the installed plugin stores encrypted, external or otherwise unsupported data, obtain its migration instructions and leave that component unresolved until tested.
Sources & verification
Product details and prices can change. Check the linked provider before buying.
- WordPress Advanced Administration Handbook: Migrating WordPress Accessed 2026-09-14
- WordPress Developer Resources: wp search-replace Accessed 2026-09-14
Sources link directly to providers. Product buttons may use separately labeled affiliate links. Read our disclosure.