Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FlexDeploy offers several options to rollbacks, each providing flexibility depending on the rollback needs. After each Deploy execution, FlexDeploy provides an option to initiate a rollback, allowing users to revert changes made during the deployment.

...

1. Project Version (Versioned Artifacts)

FlexDeploy maintains a history of builds and deployments through versioned artifacts. Each build creates a new version of the package, allowing you to deploy any previous version of a package if you need to rollback to a prior state.

When to Use This Option: When you need to revert to a previous state for all files in or a specific files within a package, you can use versioned artifacts Project Version Source Type for rollback. This option is ideal if you want to restore the entire package or individual files to a prior versionstate quickly and efficiently.

a. Navigate to the Package Execution and identify the previous version.

...

b. Click on the Rollback - Select the Project Version Source Type and Submit it for redeployment.

...

previous version as Rollback Value.

...

c. Click Submit to initiate the rollback process.

...

2. SCM

...

Revision

When files are committed to a source control system (such as GitHub, GitLab, or Azure), a commit history and file revisions are created. FlexDeploy can leverage these revisions for rollback.

When to Use This Option: When you need to revert to a prior state for one or specific files within a package, you can use SCM file revisions for those files. This option is ideal if you only need to restore individual files or a subset of files to a previous version in a package.

a. In FlexDeploy, click on Build and select the second option, File Revisions. Choose the previous file revision you want to restore or roll back.

...

Click on the Rollback - Select SCM Revision Source Type and File Revision as Rollback Value.

...

b. Click Submit to initiate the rollback process.

...

3. Backups Repository

FlexDeploy takes backup of the metadata from the target org before deployment and stores these backups in a designated Backups Repository on the FlexDeploy server. Backup Repository needs to be configured in order to use this option.

...

b. To restore the backed-up files, you can create a deploy input that replaces the current artifacts with the backups and then deploy them. You can either create a separate workflow for Rollback Deployment to use instead of the Deploy Salesforce workflow, or modify the existing Deploy Salesforce workflow and add execute step before deploySalesforce step. Ensure that the modified version is not activated. When deploying backup files, select the appropriate workflow version from Deploy Request > Advanced > Workflow Version.

...

Use following Code Snippet (shell) in execute step -

Code Block
if [ -f ${FD_BACKUPS_DIR}/*.zip ] 
	then
	  echo "Back file exist"
	  ls -ltr ${FD_BACKUPS_DIR}
	  rm -r ${FD_ARTIFACTS_DIR}/*.zip
	  cp ${FD_BACKUPS_DIR}/*.zip ${FD_ARTIFACTS_DIR}
	else 
		echo "Backup file does not exist."  
fi

...

cClick on the Rollback - Select Backup Repository Source Type and current version as Rollback Value.

...

c. Click Submit to initiate the rollback process.

d. Alternatively, you can add the backed-up files to source control and manually build and deploy them.

...

4.

...

Delete (Rollback Option for Deleting Files)

The above rollback options do not directly support the rollback also allows you to remove/deletion of files , that were newly deployed or mistakenly deployed to the target org. This option helps you remove unnecessary files is useful when you need to undo changes by deleting specific files or components from the target org or delete files that were mistakenly deployed.

If you wants to delete files or components from the target Salesforce Org as a part of a rollback, then you must use the Destructive Changes functionality. This functionality allows you to remove components that are no longer needed. For detailed information on how to implement destructive changes, please refer to - https://flexagon.atlassian.net/wiki/spaces/FD90/pages/10926703549/Salesforce+Tutorial#Support-of-Destructive-Packages follow these steps:

a. Click on the Rollback - Select the Delete option, use the toggle button to select the specific files that you want to delete.

...

b. Click Submit to initiate the rollback process.

...

Rollback for Data Files (Data Deployment)

FlexDeploy also supports rollback for Data Files (e.g., .csv files) containing Salesforce object records. After a data deployment, FlexDeploy allows users to revert records or data changes if necessary.

Currently, FlexDeploy only supports rollback for data files using Project Version with the following limitations:

When to Use: If data (such as Salesforce Object records) have been inserted or modified (updated or upserted), and you need to revert the data back to a previous state, you can use the rollback option to restore the earlier version of the data.

Example Scenario:

  1. When you initially insert data, FlexDeploy will deploy that data in the target org.

  2. If you later perform updates or upserts on those same records (for example, modifying the records), and then you want to revert to the original state, you can use the rollback option.

  3. The rollback will restore the data to its prior state, undoing the updates or changes made to the records since the last insert.

a. Click on the Rollback - Select Project Version Source Type and previous version as Rollback Value.

...

b. Click Submit to initiate the rollback process.

...

Additional Notes for Rollback

1. Skip: If you want to perform a rollback for specific files (and not all files in the deployment package), FlexDeploy allows you to Skip any files that do not need to be rolled back, even if they are listed in the package. This ensures that only the files you select will be reverted, while others will remain unchanged.

...

2. Notes: Before submitting a rollback request, you must provide a Notes. This field is mandatory for all rollback requests, and it is available for all workflow request types. The note can be reviewed later in the project execution history or in reports.

...

Rollback capabilities in FlexDeploy for Salesforce development offer flexibility, precision, and confidence in deployment management. Whether you are reverting a full deployment or rolling back specific components, FlexDeploy’s versioned artifacts, file revisions, and backups repository provide the tools necessary to ensure system stability and minimize downtime. By integrating rollback strategies into your deployment workflow, you can ensure smoother, more reliable Salesforce development and maintenance.