Skip to content

[EXPERIMENTAL]: Synchronising production to staging

Jelle Siderius edited this page Sep 26, 2022 · 2 revisions

Before using this option, it is recommended to make a backup of the staging environment.

Feature added in version 0.7.3.

To use the production to staging synchronisation, set a stagingUsername key in the production.json file explained here: https://github.com/jellesiderius/mage-db-sync/wiki/Configuring-settings-and-databases#configuring-databases. If this is set, mage-db-sync will search the SSH details of the given staging key/username and start the importer.

How does the production to staging synchronisation work?

  1. If the stagingUsername is configured in production.json, it will search for the given key in staging.json
  2. Mage-DB-Sync downloads the production database to your localhost. Then it will upload the downloaded database to the given staging environment
  3. Mage-DB-Sync will save the most important core_config_data settings such as URL's, email, payment, shipping settings. It will automatically block robots by adding a NOINDEX, NOFOLLOW
  4. Mage-DB-Sync will import the production database to the staging database and add the save core_config_data settings from step 3
  5. After the import is done, it will do a reindex and a cache flush. Your staging environment should be ready to use now