npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sfdmu

v4.37.0

Published

The SFDX Data Move Utility (SFDMU) is the most modern and powerful salesforce data migration tool. It will help you to populate your org with data in minutes.

Downloads

21,950

Readme

SFDMU SFDX Data Move Utility (SFDMU)

Version Downloads/week Downloads/total GitHub stars GitHub contributors License PRs Welcome

The SFDX Data Move Utility (SFDMU) is an advanced SFDX plugin designed to streamline data migration within various Salesforce environments, including scratch, development, sandbox, and production orgs.

This powerful tool supports migration from other Salesforce orgs or CSV files and efficiently manages various data operations, enabling the migration of multiple related sObjects in a single run.

Key Features:

  • Comprehensive Migration Support: Enables direct Org-to-Org data migration, eliminating the need for CSV intermediates, and supports CRUD operations: Insert, Upsert, Update, Delete.
  • Multiple Objects and Relationships: Manages migrations involving multiple object sets and handles complex relationships, including circular references.
  • Ease of Use: Simplifies the configuration process with a single export.json file.
  • Secure and Local: Ensures data security as all operations are performed locally without cloud interactions.
  • High Performance: Optimizes processing by focusing on necessary data subsets.
  • Extended Functionality: Provides advanced features such as custom field mapping, data anonymization, and supports composite external ID keys among others.

Installation Instructions:

  1. Prepare Environment: Install the Salesforce CLI following the official instructions.

  2. Plugin Installation:

    # Uninstall old version, if any:
    $ sf plugins uninstall sfdmu
       
    # Install the latest version:
    $ sf plugins install sfdmu

Detailed Setup for Developers:

For developers needing customization or access to the source:

# Clone the repository:
$ git clone https://github.com/forcedotcom/SFDX-Data-Move-Utility
# Navigate to the directory and link it:
$ cd SFDX-Data-Move-Utility
$ npm install
$ sf plugins link

Migration Configuration:

Set up a migration job by creating an export.json file with specific data models and operations, as detailed in the Full export.json Format Guide.

Here is a basic export.json example for upserting Accounts and their related Contacts, assuming a unique Name for Accounts and a unique LastName for Contacts across source and target orgs:

{
    "objects": [
        {
            "operation": "Upsert",
            "externalId": "LastName",
            "query": "SELECT FirstName, LastName, AccountId FROM Contact",
            "master": false
        },
        {
            "operation": "Upsert",
            "externalId": "Name",
            "query": "SELECT Name, Phone FROM Account WHERE Name = 'John Smith'"
        }
    ]
}

Description of JSON Content:

  1. First Object (Contact):

    • Operation: "Upsert" - Can be "Update", "Upsert", "Insert", "Delete", among others as specified in the documentation.
    • External ID: "LastName" - Used as the unique identifier for Contacts to support upsert operations.
    • Query: "SELECT FirstName, LastName, AccountId FROM Contact" - Defines the fields to be transferred from the source to the target during the migration. This ensures that only the specified fields are processed.
    • Master: false - This setting ensures that SFDMU only processes Contact records that are related to the specified Accounts.
  2. Second Object (Account):

    • Operation: "Upsert" - Specifies the type of operation for Accounts.
    • External ID: "Name" - The unique identifier for Accounts, used for upsert operations.
    • Query: "SELECT Name, Phone FROM Account WHERE Name = 'John Smith'" - Selects specific Accounts by Name for the operation. This ensures that only Accounts with the name "John Smith" are targeted for the upsert.

Migration Execution:

Navigate to the directory where your export.json file is located and execute migrations using commands tailored to your source and target, whether they are Salesforce orgs or CSV files:

# Migrate data from one Salesforce org to another
$ sf sfdmu run --sourceusername [email protected] --targetusername [email protected]

# Export data from a Salesforce org to CSV files
$ sf sfdmu run --sourceusername [email protected] --targetusername csvfile

# Import data from CSV files to a Salesforce org
$ sf sfdmu run --sourceusername csvfile --targetusername [email protected]

Note:

When importing or exporting from/to CSV files, ensure that the files are located in the directory containing the export.json file. The files should be named according to the API name of the respective sObject, such as Account.csv, Contact.csv. This naming convention helps in accurately mapping the data to the correct sObjects during the import or export process.

Watch the Demo

  • Experience the plugin in action here.

Documentation Links:

Additional Notes

  • If you encounter permission issues on MacOS, prepend your commands with sudo. Adjust CLI command syntax if using the older SFDX CLI platform.
  • To allow SFDMU to connect to your source and target orgs, ensure you have established a local connection to these orgs using the standard sf org login web commands, as detailed in the Authorize an Org Using a Browser documentation.