A plugin for the Salesforce CLI that makes it easy to migrate from Territory Management (TM1) to Enterprise Territory Management (TM2) by creating a structured, multi-step environment to automate the extraction, transformation, and deployment/load of metadata and data from TM1 to TM2.
Installing the TM-Tools Plugin is easy if you have already installed the Salesforce CLI.
Open a terminal window (command prompt) and enter the following:
$ sfdx plugins:install territory-management-toolkit
Important Notes:
sfdx plugins:install
command pulls the plugin source code directly from the territory-management-toolkit package, hosted by NPMBefore following the steps in this section, it’s recommended that you create a special directory on your local machine for this migration project.
Navigate to the directory where you’d like to create your migration project and enter the following:
mkdir MIGRATION_TEST
Make sure to follow steps 1-4 BEFORE you contact Salesforce to disable Territory Management (TM1) and enable Enterprise Territory Management (TM2).
sfdx tmtools:tm1:analyze -d MIGRATION_TEST
sfdx tmtools:tm1:extract -s MIGRATION_TEST
sfdx tmtools:tm1:transform -s MIGRATION_TEST
sfdx tmtools:tm1:clean -s MIGRATION_TEST
Make sure to follow steps 5-7 AFTER you contact Salesforce to disable Territory Management (TM1) and enable Enterprise Territory Management (TM2).
sfdx tmtools:tm2:deploy -s MIGRATION_TEST
sfdx tmtools:tm2:load -s MIGRATION_TEST
Once this step is completed, you will need to activate your imported Territory2
Model.
Activate the Imported Territory2 Model
Open Setup in the Territory Management Test org and do the following.
terr
in the Setup menu’s quick find boxPlease note that the tmtools:tm2:deploysharing
command will not allow execution unless you have activated the Territory2
Model as directed in the previous step.
sfdx tmtools:tm2:deploysharing -s MIGRATION_TEST