> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/data-migrator/history/rolling-back-a-migration.md).

# Rolling Back a Migration

## ![](https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FcfMTqg4Brbm9baWutclZ%2FSummary2-Small-Icon.svg?alt=media\&token=d1cf162d-c02d-4184-988e-7f7350e450fc) Overview

This article explains how a data migration Rollback works and how to perform one. A Rollback reverts your organization's migrated records to their pre-migration values: updated records are restored to their previous values, and inserted records are deleted.

### **How Rollback Works**

A Rollback reverts your migrated records to their pre-migration state. To maintain data integrity, a Rollback reverts all objects, records, and fields defined in the migration template.

Data Migrator uses two commands to migrate records: UPDATE and INSERT. Each command is handled differently during a Rollback.

**UPDATE**

The UPDATE command applies to records that are matched between the source and target organizations through record mapping. Before Data Migrator applies the update to the target record, it saves a snapshot of that record. The snapshot includes only the fields defined in the migration template. During a Rollback, Data Migrator applies the snapshot to the target record, returning the migrated fields to their pre-migration values.

**INSERT**

The INSERT command migrates a new record to the target organization. When a record is inserted, Data Migrator records the new record's ID. During a Rollback, Data Migrator uses this ID to identify the inserted record and, because the record did not exist in the target organization before the migration, deletes it.

{% hint style="warning" %}

#### **Potential Data Loss**

A Rollback restores records to their pre-migration values, so any changes made to a record after the migration are also lost. This applies to records that were either updated or inserted during the migration.
{% endhint %}

#### **Rollback Availability and Limitations**

* Rollbacks are currently available indefinitely. A future Data Migrator update may add a time limit on how long a rollback remains available. If a limit is introduced, this note will be updated to reflect the change.
* You cannot select specific objects and roll them back individually.
* For data migrations performed before the Rollback feature was released, the **Rollback** button will not be available.

#### **How Rollback Data Is Stored**

Data Migrator migrates records directly from the source organization to the target organization in a single, in-transit process. It persists only the migration results and the rollback snapshot.

Before a migration runs, Data Migrator stores a snapshot of the existing records so the migration can be reversed. The data stored depends on the command used:

* **Inserted records:** Only the record IDs are stored. During a Rollback, these IDs are used to delete the inserted records.
* **Updated records:** Only the field values needed to restore each record to its pre-migration state are stored.

#### **Encryption**

The rollback snapshot is encrypted at rest using SSE-S3 (AWS-managed keys) and stored within your Data Migrator tenant. Data is also encrypted in transit during migration. Data Migrator does not currently support Bring Your Own Key (BYOK).

## Rollback Migration

{% stepper %}
{% step %}

### Select Migration

1. Click **History** from the left sidebar menu.
2. Click the **Migrate** operation you wish to roll back.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FqwHkiA9mKpFLbSIAS6vP%2FRollingBackAMigration-S01-01.png?alt=media&amp;token=8d4a07e6-3b4d-4ffc-b42a-4d372b506665" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Start Rollback

1. Click **Rollback**.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FtKrtEm24GmfWvjNk9hQQ%2FRollingBackAMigration-S02-01.png?alt=media&amp;token=3c34cdb2-6618-4693-a270-ee2db2a906fd" alt="" width="563"><figcaption></figcaption></figure></div>
2. Review the table to see the total number of records to be rolled back, how many will be restored, and how many will be deleted.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FWlh4DiuXTxoQPezD7kR8%2FRollingBackAMigration-S02-02.png?alt=media&amp;token=78dc71e2-810a-4b01-9cfc-18f2c5fd1521" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
During a Rollback, each record is either restored or deleted, depending on how it was migrated.

* **Restored**: Records that existed before the migration were migrated with an UPDATE operation. These records are restored to their previous values.
* **Deleted**: Records added during the migration were migrated with an INSERT operation. These records are deleted because they did not exist before the migration.
  {% endhint %}
  {% endstep %}

{% step %}

### (Optional) Disable Automations

When running a rollback, automated Salesforce processes remain active by default. To prevent these processes from triggering during the rollback, you can selectively disable them at the object level. Disabling automations for one object affects only that object.

Each process below is disabled individually for each object in the template.

* **Triggers**
* **Workflows**
* **Flows**
* **Validation rules**
* **Lookup filters**

Automated processes are disabled only during the rollback and are restored once the rollback is complete.

{% hint style="warning" %}
Automations are disabled only for the objects they are selected in. They remain enabled for other objects in the template. Disable automations for each object you want to affect.
{% endhint %}

1. To disable Salesforce automations for an object, click **Automations**.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FWJrLVXDkSJo5MSh4qJyI%2FRollingBackAMigration-S03-01.png?alt=media&amp;token=a71ee296-ffb0-4dd5-bdcb-57938ab98231" alt="" width="563"><figcaption></figcaption></figure></div>
2. Check any of the automations you want to disable.
3. Click **Save**.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FRAvBwYkj0W729Neqn6N4%2FRollingBackAMigration-S03-02.png?alt=media&amp;token=cc8d49f7-11ae-4468-8f5c-166f10ce1133" alt="" width="375"><figcaption></figcaption></figure></div>
4. When automations are disabled for an object, the **Automations** button will display a red dot.
5. Repeat this for all objects you want to disable automations for.
   {% endstep %}

{% step %}

### Run Rollback

1. Click **Run** to start the Rollback job.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2Fo65HG6F5z8ts3ElD5Zr0%2FRollingBackAMigration-S04-01.png?alt=media&amp;token=d3adeee6-cc05-4540-a296-028d6aae46fe" alt="" width="563"><figcaption></figcaption></figure></div>
2. After you start the Rollback job, it will appear on the **History** page.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FZtyNkDZHXRVSFa5r4YEW%2FRollingBackAMigration-S04-02.png?alt=media&amp;token=b5e36dac-1fa5-440a-9910-51a39c4193c8" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Review Rollback

After the rollback completes, you can review the results to see which records changed and whether any errors occurred. The rollback job results page closely resembles the migration job results page, so the steps below provide only a brief overview.

{% hint style="info" %}
For more details, see the following article on how to view migration results.

* [Viewing Migration Results](/data-migrator/history/viewing-migration-results.md)
  {% endhint %}

1. Click **History** from the left sidebar menu.
2. Click the **Rollback** operation you wish to review.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2Fed3CKhhgswoaoEavb6SL%2FRollingBackAMigration-S05-01.png?alt=media&amp;token=68683c94-f139-46b9-bd25-431cb359c574" alt="" width="563"><figcaption></figcaption></figure></div>
3. Check for any **Failed Records**.
4. Click each object on the template canvas to view detailed results for the object.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FcDP0cBauc5rTSNOTt0pL%2FRollingBackAMigration-S05-02.png?alt=media&amp;token=5c6cfebb-14aa-4b6b-b236-587c33fca90e" alt="" width="563"><figcaption></figcaption></figure></div>
5. Each record that was rolled back will list whether it was deleted or restored in the **Operation** column.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FTnSO2pvDXXEFYeL6PYrd%2FRollingBackAMigration-S05-03.png?alt=media&amp;token=0b9e118f-84af-48ea-b694-445ec53cc828" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/data-migrator/history/rolling-back-a-migration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
