Before you can run a data deployment, you must manually enable Gearset's data loader. Running a data deployment in Gearset is a quick and simple process:
Select source and target
Using the left-hand side menu, navigate to the Configure and deploy page under
Data deployments
.
Click on the
Configure data deployment
button. Select the source and target orgs to be used and clickConfigure deployment
. The orgs must be owned by your username and authenticated by OAuth, and not username/password.
You can also deploy data to and from Salesforce DX scratch orgs. To find out how to configure and create scratch orgs within Gearset, see our support guide. However, you will not be able to select a delegated org for deploying data.
Select primary objects to deploy
Gearset will now perform a Salesforce listMetadata
call to retrieve the object list from the selected source and target organizations, and display the results in a tree view.
For each parent object in the tree, you can specify the number of records to retrieve, up to a maximum of 100,000.
When a parent object is expanded, which you can do by clicking on it, Gearset checks for and lists any dependencies that are detected that can then be included within your data subset.
Gearset will then traverse the dependency graph to determine any further indirect dependencies (up to 15 levels) necessary to deploy records from the selected objects.
Use the object filter
Configure filters
settings to customize your data set and retrieve and deploy records based on the field value.
Use the
Filter using parent object
to further filter the records to deploy, by restricting it based on the parent object.For the example below, if we tick the
Only deploy ... children of Accounts.Contacts
- this will only include children of the selectedAccounts
that ALSO have .com in the Email field. Most likely this will be less than the 16 records displayed that match theContact
object filter.
Once the objects have been selected, click
NEXT
.
Select matching configuration and related objects
Choose how you want to match existing records, which related objects to include (this is determined by
lookup
andmaster-detail
fields — see this article for more info), and customize their field mapping for upserting.
Note that if the linked orgs are
RelatedOrgFullDeployment
orgs (e.g. sandboxes and production orgs, but not developer orgs), then, in addition to the "Create new records" and "Upsert records" deployment methods, there is also a "Don't deploy" option. This option will not deploy any records for the selected object, with Gearset assuming that the records are already on the target org.The field chosen to match records for upserting can be an
External ID
field or anID Lookup
field. (You can create a custom field with theExternal ID
property, and view this in Salesforce. TheID Lookup
property is visible only via the API in Workbench.) If neither of those types of fields exists, new records will be created.
You can upsert with
ID
when any of these are true:The source is "backup" and the target is the original org.
The source is the same org as the target.
The source is a sandbox, the target is a sandbox, and they're sandboxes of the same org.
The source is a prod org, the target is a sandbox, and the target is a sandbox of the source org.
Choose whether you'd like the data deployment to continue if it hits an error deploying a record. In that case, if a deployment step fails, the remaining deployment steps will continue to execute, ignoring the errors encountered and deploying as many of the records as possible. Or, if you want the deployment to stop in the event of an execution step error, select the
Stop deploying remaining records
option.
By default, all the fields that belong to the selected objects will be deployed. If you would like to exclude certain fields from the deployment, you can click the arrow on the right side of the
NEXT
button and selectExclude fields
.You will have the option to check the list of fields for each object, and you can simply untick the ones that you would like to leave out of the deployment.
Click
NEXT
to continue and configure data masking.
Select data masking options
Choose whether you want to mask any fields to obfuscate their values. If a field is masked, Gearset will deploy fake values instead of the real values for that field, concealing sensitive customer information. Learn more about data masking.
Once you've chosen which fields to mask, click
PRE-DEPLOYMENT SUMMARY
to review the data to be deployed. Gearset will create and list out the steps we’re about to take in your data deployment.
Deploy the data records
You'll be able to see the object records to be deployed, the actions Gearset will take to retrieve the records, such as fetching, including, creating and upserting, as well as the field count and any applied filters.
Click on
DEPLOY DATA
to deploy the selected data to the target org. When the deployment is running, each stage will mark as completed and show you how many records have been processed in each step.If you're deploying to a production org, you'll be asked to confirm that you're happy to proceed before the deployment runs.
Once complete, you'll have your subset of data available for any testing and debugging you'd like to perform on the target org.
The deployment will be stored in your data deployment history in the app. From here, you can view previous data deployments, their status, and view the details of which records were moved. Learn more about data deployment history here.
Deploy Audit fields
By default, when deploying data from a source org to a target org, the Created Date and Last Modified Date of the new records will be set to the date of the deployment.
This can be problematic where users build reports analyzing data by Created Date.
However, if the "Create Audit Fields" permission is enabled in the target org, the user performing the deployment has this permission, and the Insert operation is used for the object during the data deployment, then inserting the Created Date and Last Modified Date is possible.
Using the Upsert operation does not allow the CreatedDate to be inserted.
Note:
If Gearset needs to do any additional updates later in the deployment i.e. updating lookup fields at the end of the deployment, then the
LastModifiedByID
andLastModifiedDate
might become updated to be Gearset user doing a modification.With these permissions, users can fill audit fields on record creation only through API tools. Future edits (updates) cannot be made.