Skip to content

Synchronize Environments: Copy Down

There are two major steps in the entire development cycle which must be properly synchronized for the Strapi platform. Strapi's Admin Panel allows for a number of customizations for each data collection, e.g., adjusting the element creation screen and list view for a collection. On the other hand we need to make sure, that the staging/development databases can be refreshed with production data where required.

  1. Admin Panel Customizations: Customizations to the Admin Panel can only be done in the production environment, because we can never copy-up (development -> staging -> production) data, as we would spoil our production database

  2. Synchronizing Data across Environments (copy-down): In order to refresh data in staging or development environments we have to copy-down (production -> staging -> development) production data to the subsequent environments (including the customization settings above). This should be done after every release - note that after making changes to the Strapi development one should not copy-down anymore as quite obviously changes made in development would be overwritten by this process.

For the copy-down process we use the production data backups generated automatically every day. If the development server is not connected to the backups store, backup files need to be copied manually.

sh
scripts/strapi/restore_strapi.sh
scripts/mysql/restore_mysql.sh

TIP

After deploying a new version copy-down should be done one day later in order to pick up the backups of the new release. If for reasons waiting for one day is not possible, the backups (Strapi, databases) can be triggered manually using the available scripts.

Sometimes logging into the database management (adminer) tool and using its backup (and on the target server restore) functionality is easier and more specific than just restoring the entire Webserver database

The reason why we use both the Strapi backup and the database backup is explained here

Released under the MIT License.