Export.json File Overview.


Table of Contents



Configuring SFDMU with the export.json File

As documented here , the SFDMU relies on a single configuration file named export.json to tailor the data migration process. This JSON file allows for detailed customization through various objects and properties.

Understanding the export.json File Structure

The export.json file is structured with specific JSON objects and properties to define how data is transferred between Salesforce environments. Below is an outline of key components typically included in this configuration file.

{
  "objects": [
    {
      "query": "SELECT Id, Name, Phone FROM Account",
      "operation": "Upsert",
      "externalId": "AccountExternalId__c"
    }
  ],
  "objectSets": [
    {
      "objects": [
        // This array should contain the list of object names processed within this set.
      ]
    }
    // Additional object sets can be added here.
  ]
  // Additional export.json settings if needed.
}
  • objects: (Mandatory property) This array of ScriptObject objects contains the specific Salesforce objects to be migrated. Each object can have its own set of configurations such as:
    • query: (Optional property) The SOQL query to fetch data from the source.
    • operation: (Optional property) Specifies the type of operation (e.g., Insert, Update, Upsert).
    • externalId: (Optional property) Field used as a unique identifier to relate records between source and target.
  • objectSets: (Optional property) An optional array of ScriptObjectSet objects where each item is a collection of related objects to be processed together.

Notes on Configuration

  • Ensure the SOQL query includes all fields necessary for the migration and that they are accessible according to your Salesforce org's permissions.
  • The operation types and external ID configurations must align with your data integrity and duplication management strategies.
  • It's mandatory to specify either the objects or objectSets property in your configuration.

Export.json Object Model

Script Object

The export.json file features a root Script object which allows defining global migration parameters. Properties set within this Script object apply globally and can override similar properties specified in child objects within the configuration hierarchy.

Detailed information: Script Object

ScriptObjectSet Object

The ScriptObjectSet object is used to segment a large migration job into smaller, manageable sub-jobs within the SFDMU configuration. Each ScriptObjectSet can contain a subset of ScriptObjects, which execute together as a separate sub-job.

Detailed information: ScriptObjectSet Object

ScriptOrg Object

The ScriptOrg object in the SFDMU export.json file provides connection information such as the username, instance URL, and access token. This is especially useful when the Salesforce orgs involved in the migration are not connected through the Salesforce CLI on the local machine executing the job.

Detailed information: ScriptOrg Object

ScriptObject Object

The ScriptObject object within SFDMU's export.json file allows for customizing migration parameters for specific Salesforce objects (sObjects). Properties set within a ScriptObject override the same properties in all nested objects in the configuration hierarchy.

Detailed information: ScriptObject Object

MappingItem Object

The MappingItem object within SFDMU's export.json is essential for configuring optional field mappings for each ScriptObject. This feature allows you to map data from fields in the source object to fields in the target object.

Detailed information: MappingItem Object

MockField Object

The MockField object in the SFDMU export.json file is used for setting up optional data anonymization for specific sObjects within a migration job. This feature is activated by setting the updateWithMockData property to true and defining the mockFields array within the ScriptObject.

Detailed information: MockField Object

AddonManifestDefinition Object.

The AddonManifestDefinition object within the SFDMU's export.json file is designed for specifying custom add-ons that enhance the migration process by introducing additional functionalities like scripts or automated tasks before, during, or after the migration of specific sObjects.

Detailed information: AddonManifestDefinition Object

Additional Notes

  • Compatibility: The objects and objectSets properties can be set simultaneously in export.json. The global objects array is processed first, followed by the ScriptObjectSets.

  • External ID Sensitivity: External ID fields are case-sensitive and must exactly match their metadata representation in Salesforce.

  • Permanent Deletions: Enabling HardDelete will permanently remove records for the given sObject. Ensure you are aware of the implications, especially when deleteOldData is true, as it uses the Bulk API for hard deletions.

    Refer to the relevant Salesforce documentation for more details on Hard delete records from Salesforce and Activation of Bulk API Hard Delete on System Administrator Profile

Last updated on 29th Apr 2024