Skip to content
Suggest a correction

Back up and restore configuration

Guide3 min read

Keep a restorable copy of the Check Sets and Checks your organization created, so you can recover them after an accidental change, move them to another org, or reinstall Record Health Check. Check Sets and Checks are Custom Metadata records, so you back them up with Salesforce metadata tools, not with a data export.

Back up before every upgrade, before a large configuration change, and always before uninstalling. Uninstalling Record Health Check deletes every Check Set and Check in the org, including the ones your organization created.

Custom Metadata TypeAPI name in your orgContains
Record Health Check Setrhc__Record_Health_Check_Set__mdtEach Check Set: its object, card settings, and publication settings
Record Health Checkrhc__Record_Health_Check__mdtEach Check: its evaluation, messages, and its Check Set

Back up both types together. Each Check refers to its Check Set by name, so a Check cannot be restored without its Check Set.

Records whose API name starts with rhc__, such as rhc__Example_Account_Check_Builder_Guide, install with the package. Installing the package restores them, so you do not need to back them up.

Salesforce Setup has no button that downloads Custom Metadata records as a file. Use one of the two methods below, and test the restore in a sandbox before you rely on it.

Method 1: Retrieve the records with Salesforce CLI

Section titled “Method 1: Retrieve the records with Salesforce CLI”

Use this method for a versioned backup that you keep in source control. You need Salesforce CLI, a Salesforce DX project, and an authorized connection to the org, such as my-org.

  1. List the Custom Metadata records in the org:

    Terminal window
    sf org list metadata --metadata-type CustomMetadata --target-org my-org

    Record Health Check records have full names that start with rhc__Record_Health_Check_Set. or rhc__Record_Health_Check.. Your organization’s records have no rhc__ after the period, such as rhc__Record_Health_Check_Set.Account_Data_Quality.

  2. Create a manifest file, such as manifest/record-health-check-backup.xml, that lists each of your organization’s records:

    <?xml version="1.0" encoding="UTF-8"?>
    <Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
    <members>rhc__Record_Health_Check_Set.Account_Data_Quality</members>
    <members>rhc__Record_Health_Check.Billing_City_Is_Populated</members>
    <name>CustomMetadata</name>
    </types>
    <version>66.0</version>
    </Package>
  3. Retrieve the records:

    Terminal window
    sf project retrieve start --manifest manifest/record-health-check-backup.xml --target-org my-org

    Salesforce CLI saves one file per record in the project’s customMetadata folder, such as rhc__Record_Health_Check_Set.Account_Data_Quality.md-meta.xml.

  4. Open the files and confirm that every Check Set and Check you expect is there. Commit them to your organization’s source control.

To restore, deploy the same manifest to the target org. Check the deployment first with --dry-run:

Terminal window
sf project deploy start --manifest manifest/record-health-check-backup.xml --target-org my-sandbox --dry-run
sf project deploy start --manifest manifest/record-health-check-backup.xml --target-org my-sandbox

The target org must have Record Health Check installed, because the records belong to its Custom Metadata Types.

Method 2: Copy the records with a change set

Section titled “Method 2: Copy the records with a change set”

Use this method to copy configuration between a sandbox and production that are connected by a deployment connection. A change set copies records between orgs; it is not a backup file, so it cannot restore records that were deleted from every org.

  1. In the source org, open Setup → Outbound Change Sets, and create a change set with a name that states the date and purpose.
  2. Under Change Set Components, select Add. Choose the component type Record Health Check Set, and add your organization’s Check Sets.
  3. Select Add again, choose Record Health Check, and add their Checks.
  4. Upload the change set to the target org.
  5. In the target org, open Setup → Inbound Change Sets, select Validate, and then Deploy.

After a restore, check the target org:

CheckExpected result
The number and names of Check Sets and ChecksMatch the source.
Each Check’s Check SetNames an existing Check Set.
Active and Evaluation Order valuesMatch the source.
Validate configurationReports no errors.
The card on a record that passes and one that failsShows the expected results.

A configuration backup does not roll back a package version, and Salesforce does not let you install an older Record Health Check version over a newer installed one. When an upgrade is not acceptable, stop the rollout in the sandbox, as described in Upgrade an installation.