Migrate WordPress without the panic
Migrating a WordPress site sounds simple: copy the files, copy the database, done. Then the images break, half the links point to the old domain, and the admin redirects in a loop.
At WordCamp Delhi in 2017 I walked through how to do it properly.
Know what you are moving
WordPress keeps everything in a handful of database tables: posts, post meta, options, users, comments. The site URL lives in the options table, and old URLs live inside your content. Know where they are before you start.
Pick the right level
For a simple site on cPanel hosting, a cloning plugin is fine. For bigger sites, move at server level: export the database, copy the files over SSH and import. WP-CLI makes every step scriptable and repeatable, so I recommended it then and still do.
Changing the domain
Set the new home and site URL, then run a proper search-replace. WP-CLI’s search-replace or the Better Search Replace plugin handle serialised data correctly. A plain SQL replace can quietly corrupt it.
One rule
Never, ever hard-code your domain name in your code. That single habit prevents most migration headaches.


