For the rare cases we want to sync production from the development site
We already have a monthly sync that completely overrides stage and dev environments directly from production. We don't have any automation in place for the reverse process, as it can be risky but also rarely needed.
As part of the new Information Architecture project it's often easier for NROs to content freeze on production, make all the necessary changes on their dev site and then ask from the P4 team to migrate them over to production.
Till we have an automated way of doing this type of sync, below are the manual steps needed to make it work.
Preparation
Maintenance page
Install the Maintenance plugin and configure it like documented here on both development and production sites and enable maintenance mode.
Set up env variables
Replace NRO with the name of the website (eg. indonesia) you are working on:
Make sure to use the same terminal from now on, to ensure those variables are set.
Development
Export development database
Production
Backup production data
Database import
First we need to open the database sql file on an editor and remove the lines that set up LOG BIN. Those are usually on the very first and on the very last lines of the file. Those command will make the import fail due to privillege issues.
On the stateless url path make sure to adjust them accordingly for websites that are on a different domain.
Sync bucket
Flush cache
Post actions
Maintenance mode
Disable the maintenance mode from both sites. Don't remove the plugin just yet, in case it's still needed.
Cache
Trigger a new production deployment so that all content is purged from Cloudflare cache.