Deployment Step: Data
Copado allows you to create and manage deployment steps when executing a deployment. There are several types of deployment steps. In this article we will go over the Data deployment step.
A Data deployment step allows you to deploy objects based on a SOQL query, where the object represents an SOQL table and each field a table row. The external Id field enables you to identify a record. This is very helpful when you are performing several deployments, as it will allow you to distinguish the record and update it, rather than create a duplicate record.
You can use a Data deployment step to sequentially load data using several Data deployment steps. Additionally, you can deploy related records using multiple Data deployment steps. For instance, if you’re deploying account records and you want to include related contacts, invoices and invoice Items, you will then need to create 4 Data deployment steps in the following order:
Step 1: SELECT External_Id__c, Name from Account
Step 2: SELECT External_Id__c, LastName, AccountId.External_Id__c from Contact
Step 3: SELECT External_Id__c, Date__c, Number__c, Account__r.External_Id__c, Billing_Contact__r.External_Id__c from Invoice__c
Step 4: SELECT External_Id__c, Quantity__c, Unit_Price__c, Invoice__r.External_Id__c from Invoice_Item__c
For example, in the following query you need to reference the Account.External_Id__c field instead of simply referencing the AccountId field:
SELECT External_Id__c, LastName, AccountId.External_Id__c from Contact
An important consideration when working with Data deployment steps is that, since records are updated in the deployment, you have to be careful not to remove any relevant data. It is recommended that you do a backup before proceeding with the Data deployment step.
- The batch size is 200. However, it is possible to change the batch size by adding the following text to the Step name ":batch=N" where N is greater than 0 and less than 200.
Here is an example of a step name where the batch size has been set to 20: "Accounts :batch=20".
- The fields included in the query are expected to exist in the destination org (with the same API names and data types).
- Data transformation is currently not supported.