How to synchronize wordpress environments in AWS (Part I)

  1. Uploads directory
  2. Database
  3. Code base (files like wp-config.php)

Synchronizing the Database

mysqldump -h <endpoint of the RDS> -u <username> — password=<password> <DB name> > dump.sql
mkdir sqldump
mv dump.sql sqldump/dump.sql
aws s3 sync sqldump/ s3://<bucket-name>/
aws s3 sync s3://<bucket-name>/ .
mysqldump -h <endpoint of the RDS> -u <username> — password=<password> <DB name> < dump.sql
wp --allow-root --verbose search-replace "https://<source URL>" "https://<destination URL>" && wp --allow-root --verbose search-replace "http://<source URL>" "https://<destination URL>" && wp --allow-root --verbose search-replace "www.<source URL>" "<destination URL>"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store