The FlexDeploy backup repository is a directory available on the FlexDeploy server where all backups are stored. This directory needs to have at least 10GB of space available on the FlexDeploy Server. The backups repository is optional. If configured, the backup artifact returned from the deploy workflow will be stored in the Backups repository. Before the deployment operation, we can export the existing artifact from the target server and store it in the backups folder.
This directory will be specified on the command line as -Dflexagon.fd.backup.repository.root=<location>
This parameter should be added to the setenvoverride.sh or setenvoverride.bat file depending if you are using Linux or Windows.
Create the folder that you specify and ensure that the FlexDeploy user has full control of it.
Bounce the FlexDeploy server if it was running for the changes to take effect.
Not all plugins have built-in support for backups. If the one you are using doesn’t, simply copy the files you wish to backup to the FD_WORKING_DIR/backups.
When the execution runs the files in the backups folder will be backed up in the <location> that you specified, inside of folders that keep them organized.
Backups are stored in <flexagon.fd.backup.repository.root>/ProjectID/ProjectVersionId/EnvironmentId
The backups are retained for the same period as artifacts in purge settings.
Exactly 1 backup is retained for each ProjectID/ProjectVersionID/EnvironmentID. If you deploy again, the version which was replaced become the back-out version.
To view or download a backup, go to the deployment that had a backup. Click Artifacts under the deploy execution. The backups are shown below the artifacts.
Consideration to Rollback (restore the backed-up files):
As of now, there is no simple way to click and roll back the change to the backup. But it can be achieved in the following ways with simple customization.
Customize deploy workflow to deploy from the backup artifact repository. Simply copy the backup artifact to the artifacts folder before deploying.
Add an input to your workflow like Rollback as a boolean
Add an if condition. If Rollback is true, then copy the backup artifact ($FD_WORKING_DIR/backups) to the artifacts folder ($FD_ARTIFACTS_DIR)
Download the files from the Backups section of artifacts, and commit them to the SCM repository. Build and deploy as normal.
Other options for Rollback:
If FlexDeploy has an older version, you could also just redeploy that older version.
If your SCM repository has a previous revision you would like to deploy, you can select the older revision to build on the Build submission form’s File Revisions tab and then deploy.