To deploy data from one Salesforce environment directly to another Salesforce environment, enter this command at the command line prompt in your Salesforce DX CLI command shell:
$ sfdx appops:deploy DATA [ENVIRONMENTS] [OPTIONS]
The parameters provide for maximum flexibility when using the CLI command. Deployment requires these three pieces of information:
- Deployment instructions (deployment plan or data set)
- The environment to use as the source of the data to deploy
- The environment to use as the source destination of the data to deploy
Here are all the available parameters:
|-p <deployment plan>,|
|Use to specify the name or record ID of the deployment plan to deploy.|
|Use to specify the name or record ID of the data set to deploy.|
Notes: Specify exactly one deployment instructions parameter. Specifying zero or more than one deployment instructions parameter results in an error. For each data set and deployment plan in the deployment, Active must be selected in the corresponding AppOps record.
|None||Use to specify the dev hub org as the source environment and the scratch org as the destination environment.|
|Use to specify an AppOps connection name or record ID as the source environment and the scratch org as the destination environment.|
|Use to specify the scratch org as the source environment and an AppOps connection name or record ID as the destination environment.|
Notes: Specify zero, one, or both org parameters. When not specifying an org parameter, you must specify the scratch and dev hub orgs either with the optional setup steps or with the -u/–targetusername and -v/–targetdevhubusername options. When specifying an AppOps connection record, Active must be selected in the AppOps connection record. When specifying an AppOps connection record as the destination environment, Do Not Allow As Destination must not be selected in the AppOps connection record. When specifying an AppOps connection record by a name that exists for more than one record, AppOps uses the last-modified connection.The dev hub org cannot be the destination environment.
|Use to specify a nickname for the environment.|
|Use to temporarily deactivate all events AppOps has permission to deactivate.|
|Use to preview the source records that would be deployed.|
|-n <deployment name>,|
|Use to specify a name for the deployment.|
|Use to include notes in the deployment results.|
|-q <query filter>,|
|Use to specify a query filter override for a data set deployment.|
|Use to specify the username or alias of the destination environment, overriding any default scratch org you specified in the optional setup steps.|
|Use to specify the username or alias of the dev hub org, overriding any dev hub org you specified in the optional setup steps.|
|–apiversion=<apiversion>||Use to override the API version used for API requests made by this command.|
|–json||Use to receive an output response. When included, the response is in JSON format. When not included, no response is given.|
|–loglevel=<level>||Use to specify the logging level for this command invocation with one of these levels:errorwarninfodebugtracefatalFor details, refer to https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_log_messages.htm.|
The AppOps service retrieves the active control environment connection information from the dev hub control org. If not found, the service returns an error and terminates.
The scratch and dev hub org connections are based on access tokens only. You cannot use refresh tokens. This requirement means the session settings you configure in the environments apply. Any deployment running for longer than the session timeout terminates on next connection access.
For any deployment involving the dev hub org, the plugin uses the control environment connection from AppOps as the control environment connection for the actual deployment, not the dev hub org connection from DX. The user who created the control environment connection in AppOps can be different than the user who authenticated the dev hub org in Salesforce DX.
The plugin uses the DX dev hub connection to query for connections and insert the result, and uses the DX dev hub connection as the source connection when the source environment is also the control environment. The AppOps service uses the control environment connection to report results and the source connection to query for data and metadata.
AppOps service inserts deployment result record into your control environment. Monitor the deployment and view the results in the Prodly AppOps app on the Deployment Results tab.