Use CLI to Deploy Changes from a Sandbox to Data Cloud

As a Salesforce developer, you can move your Data Cloud metadata and process definitions for Data Cloud features from one sandbox org to another sandbox org or to a production org. To accomplish this, you use a sandbox org that has Data Cloud enabled and provisioned. The feature metadata that you want to deploy must be added to a DevOps data kit. Once the metadata is in the data kit, you can retrieve it into a Salesforce DX project manifest. Finally, you can deploy the metadata to the production org. When you deploy changes from a sandbox, you can deploy them back to the production org or to another sandbox. This process involves multiple steps in both Data Cloud and the Salesforce Platform. Bookmark this page or keep it open in a separate window to refer to this topic.

For simplicity, this topic uses the term “production,” which can refer to the production org from which the sandbox was created or another sandbox org.

Make sure to complete these prerequisites before you create and start working with on a project.

  1. Open the VS Code editor and from the Command Palette, run SFDX: Create Project with Manifest. See Create Project.

  2. In the sfdx-project.json file, specify the login URL for the production org, which is https://login.salesforce.com.

  3. In the sfdx-project.json file, specify the login URL for the sandbox org, which is https://test.salesforce.com.

    Salesforce DX project JSON file for DevOps data kit

  1. Authorize the sandbox org and the production org to work with your Salesforce DX project. See Authorize your Production Org.
  1. Go to Data Cloud Setup and create a data space in the sandbox org and the production org. See Create a Data Space.

Note: In Data Cloud Setup, make sure that the data space with the same prefix name exists in both the sandbox org and the production org.

  1. In your sandbox org, go to Data Cloud Setup and create a data kit. See Create a Data Kit.
  2. For Data Kit Type, select DevOps.
  3. Add Data Cloud components that you want to deploy from the DevOps data kit and define the publishing sequence for these components. The components that you can add include data streams, data lake objects, calculated insights, and data graphs. See Data Cloud in a Sandbox.
  1. In your sandbox org, from Data Cloud Setup, click Data Kits.
  2. Select the DevOps data kit, and then click Download Manifest. The package.xml file that you downloaded contains all the metadata entities related to the DevOps data kit. Use this package.xml file in your Salesforce DX project to retrieve the data kit metadata.

Sample package.xml file for a data kit.

  1. To retrieve the DevOps data kit metadata into the sandbox org, run: sf project retrieve start --manifest package.xml After this command completes, you see new project folders that contain the data kit metadata. Consider uploading the entire project to GitHub or any other source control system. This practice helps with version control, collaboration, and ensures that your project is backed up and accessible to your team.
  1. To start the deployment, run: sf project deploy start --manifest package.xml. See project deploy start.
  2. To check the deployment status, click Deployment History. After the data kit deploys in the production org, you can see the data kit, including all of its data stream bundles, data models, and calculated insights. All the metadata and process definitions from your sandbox org data kit are deployed in your production org.

If any deployed connectors are in an inactive state, re-authorize them in the production org, and deploy the data kit again. Connections are replicated to the sandbox, but the authorization data isn’t replicated.