Get Started.


SFDMU (Salesforce Data Move Utility) allows you to populate your Salesforce org with high-quality record data in three simple steps.


Table of Contents



Step 1. Install the SFDMU

Ensure the SFDX CLI is already installed on your system. Follow this guide to install the SFDX CLI if you haven't yet. Use the following commands to manage SFDMU installation:

# Uninstall an old version of the Plugin, if any:
$ sf plugins uninstall sfdmu

# Install the latest version of the Plugin:
$ sf plugins install sfdmu
Notes:
  • If you encounter permission issues on MacOS, use the sudo prefix with the installation command:
$ sudo sf plugins install sfdmu

Step 2. Configure the Migration Job

Basic Configuration Example: Upserting Accounts

Create an export.json file like this for basic account upserts:

{
    "objects": [
        {
            "query": "SELECT Id, Name FROM Account",
            "operation": "Upsert",
            "externalId": "Name"
        }
    ]
}

Advanced Configuration Example: Upserting Multiple Related SObjects

Assume, the data model appears as the following:

image

For this data model with complex circular relationships, use a configuration like this to maintain relationships during upserts:

{
    "objects": [
        {
            "query": "SELECT Id, Phone, TestObject3__c FROM Account WHERE Name LIKE 'TEST_ACC_%'",
            "operation": "Upsert",
            "externalId": "Name"
        },
        {
            "query": "SELECT Id, Account__c, TestObject3__c, RecordTypeId FROM TestObject__c",
            "operation": "Upsert",
            "externalId": "Name"
        },
        {
            "query": "SELECT Id, Account__c, TestObject__c FROM TestObject2__c",
            "operation": "Upsert",
            "externalId": "Name"
        },
        {
            "query": "SELECT Id, TestObject2__c FROM TestObject3__c",
            "operation": "Upsert",
            "externalId": "Name"
        }
    ]
}

Important Notes

  • Ensure the correct spelling of object API names in export.json queries as they are case-sensitive.

Step 3. Run the Migration Job

Navigate to your export.json directory and execute the appropriate command to initiate migration:

  • Direct migration between Salesforce orgs:
$ sf sfdmu run --sourceusername source@name.com --targetusername target@name.com
  • Import data from CSV files:
$ sf sfdmu run --sourceusername csvfile --targetusername target@name.com
  • Export data into CSV files:
$ sf sfdmu run --sourceusername source@name.com --targetusername csvfile

Demonstration Video

Watch SFDMU in action in this demonstration video.

This demonstration provides all the essential steps and configurations to get started with SFDMU for efficient data migration in Salesforce:

Last updated on 20th Apr 2024