Sync database or files between environments of a project
In any Environment sidebar, you can find a ‘Sync’ item under the ‘Shortcuts’.
(If you don't have the correct permissions, this item will be greyed out)
Clicking the items opens a modal, giving you some options:
- What: The Type of sync (database or files)
- From: The source Environment
- To: The target Environment (which database or files will be overridden by the source)
You will notice that by default, the environments are prefilled with the name of the Environment you are currently on.
Since it doesn't make sense to sync an Environment to itself, and the sync button is disabled and a warning is
displayed to remind you to pick a different source or destination Environment.
Temporary directories¶
During the syncing process, files are transferred to temporary directories. By default, this is /tmp
.
If you can't use /tmp
(e.g. your project has limited storage space in that directory), please contact the helpdesk. We can change what directory it uses on an environment by environment basis.
Sync files¶
By default, you start with ‘database’, but you can easily switch to files:
Be aware though, that you need to pick at least 1 path for the files to sync.
The available paths can not be modified individually at this time.
If you need to sync a path not available here, please contact support for further assistance.
Confirm¶
After making your choice of environments to sync, you will be asked to make a final confirmation.
Since syncing is a destructive action, we want to make sure users are sure they are using the correct environments.
As with most actions on an Environment, triggering a sync will put a job on the queue-system.
In order to see if the task is still in progress, you can either refer to the progressbar in
the header or the pending notifications in the sidebar.
You will get a new notification when the task is finished.
Sanitization of data¶
You may require the database to be sanitized when syncing to another environment.
This can be done with the use of a platform.sanitize.yml file. For more information, see the relevant page.