Performing Salesforce Record-level Restore Operations


You can restore the records of an object to a file system or to a Salesforce instance. You can restore only records from the most recent backup cycle.

If your Salesforce environment has the Person Accounts feature, then to restore Person Accounts records, you must select the Account Object, even if you deleted the account record from the contacts. For more information, go to "Person Accounts" on the Salesforce help site.

Tip: Due to the complexity and nature of Salesforce, some objects and records might not restore successfully. Issues that can block records from being restored include API limitations, data integrity, complexity in hierarchical relationships, and automation processes that utilize triggers, flows, and rules. To avoid errors or for faster results, disable the validation rules, Apex triggers, flows, and workflows. For the same benefits for managed packages, uninstall the packages. (Managed packages cannot be disabled using APIs.)

Before You Begin


  1. From the navigation pane, go to Protect > Salesforce.

    The Salesforce page appears.

  2. For the organization that contains the data that you want to restore, click the action button , and then click Restore.

    The Select restore type page appears.

  3. Click Record level restore.

    The Backup content page appears.

  4. From the Object list, select the object that you want to restore.

    The records for the object appear in a table.

    Here you can download up to 1GB of Salesforce data in CSV format. Select one or more object records and then click Download.

  5. To filter the records, do the following:

    • To filter by version, select the versions that you want to view.

      • To show the latest record version, select Show latest version.

      • To show the all versions of the records, select Show all versions.

      • To show the deleted records, select Show deleted records.

    • To filter by SQL, click Advanced filter not set, and then select Set advanced filter.

      The Advanced filter dialog box appears.

      • In the box, enter valid SQL query, and then click OK.

    • To filter by fields, click + Add filter, and then do the following:

      The Filters dialog box appears.

      1. From the Filter by list, select the filter that you want to use.

      2. From the Condition list, select the condition that you want to apply to the filter.

      3. Beside the condition, enter a value.

      4. To add additional rules to filter by, click Add Rule.

      5. Click Apply Filters.

  6. To add additional fields to the view, click the columns button , and then select the fields.

  7. To create a new view, do the following:

    1. On the upper-right of the page, click the gear icon .

    2. In the Save view as box, enter a name for the new view.

    3. Below Rules, add new rules to filter the data by.

    4. To set the new view as the default view, select the Set as default check box.

    5. Click Save.

  8. Select the records that you want to restore.

  9. Click Restore.

    The Restore options dialog box appears.

  10. Beside Restore target, select Salesforce.

  11. Under Destination details, from the Destination organization list, select the Salesforce organization to restore the records to.

  12. Under Options, set the restore options:

    • To include parent objects in the restore, from the Parent objects to restore list, select All parents.

      Important: Including parent objects has the following effects:

      • Data integrity is maintained. If parent objects are included and some parents do not exist or some parents have incorrect values, the restore still completes.

      • When objects such as User objects are updated, end users receive notifications, which might not be desirable.

    • To include child objects in the restore, from the Child objects to restore list, select the child objects.

    • To exclude some child objects, select the Exclude children check box, and then in the Children to exclude box, select the child objects that you want to exclude.

    • In the Field mappings dropdown, specify how field mapping should be prioritized in case of out-of-place restores.

      A field map is generated for all organizations during a backup job. This map indicates a link between each object and a corresponding field that can be used as a mapping field, i.e., has the same value across sandbox and production organizations. Field mappings determine how data from a source corresponds to data in a destination.

      This map is generated during the backup process, and eligible mapping fields are prioritized based on following criteria:

      • Field, which is an external Id, is unique and required

      • Field, which is unique and required

      If no fields for the object matches this criterion, we may create a new field called CvExternalId. This generated map can be modified as needed from the restore screen with the pencil icon. The automatically generated field maps can be edited by clicking on the pencil icon for the corresponding source or destination organization. New fields can be added and existing fields modified. Any changes made this way are retained for subsequent jobs to or from the destination or source organization.

      The source organization record ID is stored in the CvExternalId field as part of a restore job. Later, in subsequent jobs, this field is used to map the records with the source organization's ID. If a match is found, the record is updated. Otherwise, a new record is inserted. This is similar to an incremental restore job.

      CvPermissionSet is used to create a new permission set for newly created CvExternalId fields on the restored objects. This permission set is then assigned to the logged in user of the destination organization, allowing that user account to access or insert values in this field later during the restore job.

      The API name associated with CvExternalId is CvExternalId__c

      Choose one of four options:

      • Skip mapping fields: Do not use a map and fallback to the system default fields for mapping. (Examples include ID or default cloud-mapping fields.)

      • Use CvExternalId to map all objects: CvExternalId is a custom field created by the Commvault restore process. With this option selected, the Salesforce metadata API is used to create the custom field.

        If Salesforce restricts creating new custom fields on certain objects, it may return a FIELD_INTEGRITY_EXCEPTION error.

      • Use destination field mappings: The field map of the destination organization used for restore jobs.

      • Use source field mappings: The field map of source organization is used for restore jobs.

    • To disable the Salesforce triggers, flows, workflows, and rules only for the restore, select the Disable triggers and rules check box.

      After the restore completes, the flows, workflows, and triggers are automatically enabled.

    • To restore empty and null values for a backup, select the Restore empty fields check box.

    • To restore only changed and deleted records for a full object restore, select the Restore only changed and deleted records check box.

    • To associate all restored records in the destination org with the logged-in user as the record owner (if a record owner does not exist in the destination org), select the Associate ownership to the logged-in user check box.

    • To apply data masking, select the Apply masking on destination check box, and then from the Select data masking policy list, select the data-masking policy.

Note: You can apply data masking when you run a cross-instance restore and data masking policies are defined.

Click Submit.

SQL WHERE Clause Examples for Salesforce Restores