PDF
Download PDF
Download page Migrating Approval Data.
Migrating Approval Data
This section outlines the migration of Approvals the source (Dev/Test) to any other target (Dev/Test/Prod) environment.
Tools Used for Migrating Data
Dataloader.iMio (to export/ import data with reference ids) www.dataloader.io
Naming convention
- Source Environment > SrcEnv
- Target Environment > TrgEnv
To migrate data
- Ensure all other metadata is migrated beforehand. For example, any new fields created on Quote/Agreement objects which are used in Approval Process.
- Create External ID fields for the objects, if not created. Text field with external ID flag checked, with an appropriate name entered.
- Approval Process
- Approval Rule Dimension
- Approval Rule
- Approval Rule Entry
- In the approval process object, create a RecordType text formula field with the return type "Text". Formula: RecordType.Name.
- For all thes objects, copy each record's ID into the External ID fields in the SrcEnv. For this you must export the data from SrcEnv, update the data in the CSV and import the data back to SrcEnv. For example, ID and External ID should be the same for all these records in the source environment.
Exporting Data
- For Object Approval Rule Dimension export all records from SrcEnv.
- For Object Approval Rule export all records from SrcEnv.
- For Object Approval Rule Entry export all records from SrcEnv
- For Object Approval Rule Assignee export all records from SrcEnv
- For Object Approval Process from SrcEnv (copy paste the filter values)
- Export records with filter Record Type Text = Approval Process and a specific Process Name.
- Export records with filter Record Type Text = Approval Process and a specific Process Name.
- Manually update Backup Admin field in the CSV with the user id from TrgEnv.
- Export records with filter Record Type Text = ‘Entry Criteria’
- Export records with filter Record Type Text = ‘Initial Submission Action’
- Export records with filter Record Type Text = ‘Final Action’
- Export records with filter Record Type Text = ‘Step Group’
- Export records with filter Record Type Text = ‘Step’
- Blank out all data from Step Assignee ID column in CSV.
- Export records with filter Record Type Text = Step Filter Criteria.
There are 11 CSV files in total.
Importing Data
Before importing data it is recommended that you sort the spreadsheet by record name (for advanced logic purposes).
- Import ‘Approval Rule Dimension’ csv in TrgEnv. No Lookups are required.
- Import ‘Approval Rule’ csv in TrgEnv.
- Use lookup to External ID for all dimension fields.
- Import the Approval Rule Entry CSV in TrgEnv.
- Use lookup to External ID for Approval Rule field.
- Import the Approval Rule Assignee CSV in TrgEnv.
- Use Lookup to External ID for Rule Entry Field.
- Import Approval Process CSV in TrgEnv.
- Remove Mapping for RecordTypeId
- Add Mapping to the custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name.
- Import the Entry Criteria csv in TrgEnv.
- Use the lookup to External ID for Entry Criteria field.
- Remove the mapping for RecordTypeId
- Add the mapping to custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name
- Import Initial Submission Action csv in TrgEnv.
- Use the lookup to External ID for Initial Submission Action Field.
- Remove Mapping for the RecordTypeId
- Add Mapping to the custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name
- Import Final Action csv in TrgEnv.
- Use the lookup to External ID for Final Approval Action Field.
- Remove Mapping for RecordTypeId.
- Add a mapping to custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name.
- Import Step Group csv in TrgEnv.
- Use lookup to External ID for Step Group Field.
- Remove the mapping for RecordTypeId.
- Add the mapping to custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name.
- Import ‘Step’ csv in TrgEnv.
- Use Lookup to External ID for Step Field.
- Remove the Mapping for RecordTypeId
- Add the Mapping to custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name
- Import the Step Filter Criteria csv in TrgEnv
- Use Lookup to External ID for Step Filter Field.
- Remove Mapping for RecordTypeId.
- Add Mapping to custom field APTS_Record_Type_Text__c, to Record Type ID, Lookup via: Name.
There is an issue with the advanced filter logic in Step Filter Criteria as there is no sequence number stored in the export files. If you are using Advanced Filter Logic, verify it manually after importing all the data.
If the user ID is not the same across the orgs, it may cause issues, and the user ID might have to be populated manually.