Tool to manage Drawloop for Salesforce documents and make them Git-friendly
This tool has been designed as an alternative to Drawloop's DDP migration tool that migrates DDPs from one sandbox to another which doesn't allow to version control DDPs. In addition every once in a while work-in-progress DDPs get promoted to higher environments. The tool addresses these issues by allowing to pull and push DDP files and corresponding data (stored in Loop__* objects) to/from a Salesforce org. Data is stored in YAML so any small changes are easily seen in git diff.
One can either use Python sources or a Windows executable.
- Install YAML library
pip install PyYAML- Install SFDC library
pip install sfdclib- Add text field DDP_Migrator_Id__c (Length=36, External ID, Unique, Case sensitive) to the following custom objects:
- DDP: Loop__DDP__c
- DDP File: Loop__DDP_File__c
- Delivery Option: Loop__DDP_Integration_Option__c
- Relationship: Loop__Related_Object__c
- Relationship: Loop__PDF_Stamp__c
- Execute PopulateGuids.apex script to set values in DDP_Migrator_Id__c field in all five objects
- Deploy triggers and a class stored in metadata directory.
It is recommended to populate GUIDs/external IDs in Production org first and then push IDs to lower environments using push-ids command.
Install PyInstaller and then run the following command:
pyinstaller ddpmigrator.specResulting exe file can be found in dist directory.
The tool exports data and documents into the directory specified by --source-dir switch. It creates loop directory in the source directory and data and documents sub-directories.
Export all DDPs
ddpmigrator.py export --sandbox --username user@domain.com.sandbox_name --password Secret --source-dir ..Export two DDPs
ddpmigrator.py export --sandbox --username user@domain.com.sandbox_name --password Secret --source-dir .. --ddp "DDP one" "DDP two"This command is useful during rollout of DDP migrator to make sure external IDs in production and all sandboxes match. It will push external IDs stored in the source directory to a sandbox.
Update all external IDs
ddpmigrator.py push-ids --sandbox --username user@domain.com.sandbox_name --password Secret --source-dir ..The tool expects the source directory to be a Git repository so it can run 'git diff' to find changes.
Import DDPs changed since certain commit
ddpmigrator.py import --sandbox --username user@domain.com.sandbox_name --password Secret --source-dir .. --baseline 6771fbc7Import specific DDPs
ddpmigrator.py import --sandbox --username user@domain.com.sandbox_name --password Secret --source-dir .. --d "DDP one" "DDP two"