Technical Mid Level

How do you migrate a WordPress site between environments? What are the challenges with serialised data in the database?

Quick Tip

Always use serialisation-safe tools: "I export with wp db export, transfer files with rsync, and run wp search-replace for URL changes. Never use sed on a WordPress database dump — it breaks serialised data."

What good answers include

Migration involves: database export/import, file transfer (wp-content), and URL replacement. The critical challenge: WordPress stores serialised PHP data in the database (widget settings, plugin options, theme mods). Simple find-and-replace on SQL dumps breaks serialised strings because the byte-length prefix becomes incorrect. Solutions: WP-CLI search-replace (handles serialised data correctly), migration plugins (All-in-One WP Migration, Duplicator), or manual export with wp db export followed by wp search-replace. Strong candidates mention: wp-config.php adjustments for the new environment, file permission issues, the wp_options siteurl and home rows, and testing after migration.

What interviewers are looking for

Practical WordPress operations skill. Candidates who use SQL find-and-replace will corrupt serialised data and spend hours debugging mysterious breakages. Those who know WP-CLI search-replace or equivalent tools handle migrations reliably.

← All WordPress questions