Full WordPress site migration (files + DB + config) on Ubuntu

wordpressmigrationubuntuapacheops

A full migration is more than a database dump. It’s files + DB + config + routing + DNS.

⚠️ Test in staging first whenever possible.

Step overview

StepAction
1Export database (--single-transaction if live-ish)
2Sync files with rsync
3Update wp-config.php
4Update Apache vhost + docroot
5Run WP-CLI search-replace
6DNS cutover
7Verify + monitor logs

Example DB export

mysqldump --single-transaction -u <db_user> -p <database> > backup.sql

File sync example

rsync -avz /var/www/<site-root>/ user@webhost1:/var/www/<site-root>/