|
| 1 | +# Migration Tools for Digital Insurance Constraint Engine |
| 2 | + |
| 3 | +This directory contains utilities designed to streamline the deployment and migration of Constraint Rule Engine assets across Salesforce orgs. These tools enable you to efficiently move CML rule sets and associated product model metadata between your instances. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +When implementing the Constraint Rule Engine in Digital Insurance, you'll often need to: |
| 10 | +- **Migrate CML rule sets** from one org to another |
| 11 | +- **Transfer complete product hierarchies** with all dependencies intact |
| 12 | +- Transform **standard/legacy configuration rules** to **constraints** |
| 13 | + |
| 14 | +The tools in this directory address these needs with production-ready utilities that handle the complexity of cross-org data migration while preserving metadata relationships and dependencies. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Available Tools |
| 19 | + |
| 20 | +### 1. [CML Migration Tool](https://github.com/gkibilov/cml-migration/tree/main) |
| 21 | + |
| 22 | +The **CML Migration Tool** enables seamless import, export, and deployment of Constraint Modeling Language (CML) rule sets across Salesforce orgs. This tool is essential for: |
| 23 | +- Moving rule sets from sandbox to production environments |
| 24 | +- Updating of the existing rule sets |
| 25 | +- Creating backups of your CML configurations |
| 26 | +- Sharing rule set templates across multiple orgs |
| 27 | + |
| 28 | + |
| 29 | +**Note**: This tool assumes target org already has relevant Context Definition and PCM data like Attributes, Product Classifications, Products and Product Related Components. |
| 30 | + |
| 31 | +#### How to Use the CML Migration Tool |
| 32 | + |
| 33 | +1. Install [Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli) |
| 34 | +2. Authorize source org and target org |
| 35 | + ``` |
| 36 | + sf auth:web:login --instance-url https://<source-instance>.salesforce.com -a srcOrg |
| 37 | + sf auth:web:login --instance-url https://<target-instance>.salesforce.com -a tgtOrg |
| 38 | + ``` |
| 39 | +3. Check connection using ```sf org list``` |
| 40 | +4. Export from Source Org using ```python export_cml.py --developerName [Constraint Model API Name]``` |
| 41 | +5. Import to Target Org using ```python import_cml.py``` |
| 42 | +
|
| 43 | +🔧 Requirements |
| 44 | +- Python 3.9+ |
| 45 | +- Salesforce CLI (sf) |
| 46 | +- Connected orgs with accessible metadata API |
| 47 | +--- |
| 48 | +
|
| 49 | +### 2. [Multi Cloud Data Migrator for Product Models](https://github.com/sf-mcdm/multi-cloud-data-migrator) |
| 50 | +
|
| 51 | +The **Multi Cloud Data Migrator** is a comprehensive tool for migrating Insurance product hierarchy metadata and data across orgs. It ensures that all components of your product model remain consistent during transfer. |
| 52 | +
|
| 53 | +**What Gets Migrated:** |
| 54 | +- Product Definitions and hierarchies(Product Related Components) |
| 55 | +- Attribute Categories and Definitions |
| 56 | +- Picklist and Picklist Values |
| 57 | +- Pricebook Entries |
| 58 | +- and more... |
| 59 | +
|
| 60 | +**Key Features:** |
| 61 | +- Dependency-aware sequencing prevents broken references |
| 62 | +- Automated or semi-automated migration workflows |
| 63 | +- Support for complex product hierarchies |
| 64 | +- Validation to ensure data integrity post-migration |
| 65 | +
|
| 66 | +#### How to Use the Multi Cloud Data Migrator User Interface |
| 67 | +
|
| 68 | +1. Install [Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli) |
| 69 | +2. Install Multi Cloud Data Migrator Plugin using ```sf plugins install sf-mcdm/multi-cloud-data-migrator``` |
| 70 | +3. Authorize source org and target org |
| 71 | + ``` |
| 72 | + sf auth:web:login --instance-url https://<source-instance>.salesforce.com -a srcOrg |
| 73 | + sf auth:web:login --instance-url https://<target-instance>.salesforce.com -a tgtOrg |
| 74 | + ``` |
| 75 | +4. Check connection using ```sf org list``` |
| 76 | +5. Open the Web App user interface using ```sf multi-cloud-data-migrator:ui``` |
| 77 | +6. Choose **Deep Clone Migration Plan** and **Revenue-Cloud-Advanced-Product** |
| 78 | +7. Input your source and target org, and root product's SKU(Stock Keeping Unit), you can put multiple ones separating by comma |
| 79 | +8. Click **View Plan** and make sure all Key fields in SObject is populated (**note**: this is very important for clean product structure migration) |
| 80 | +9. Click "Start Migration", you can monitor the progress in "Job Monitor" tab and issues in "Failure and Skip Files" tab |
| 81 | +
|
| 82 | +#### SObject Keys Reference |
| 83 | +
|
| 84 | +For Step 8: critical to ensure your data is clean and properly prepared |
| 85 | +- Check Your Keys: Use the View Plan button to review the migration strategy. |
| 86 | +- Ensure Uniqueness: Verify that all Key fields and composite key combinations are populated and unique in the source data. |
| 87 | +- Validate Data: Duplicate or missing keys will cause records to be skipped or linked incorrectly. The migration will not run as expected if the underlying data quality is poor. |
| 88 | +
|
| 89 | +| SObject | Key | |
| 90 | +|---------|-----| |
| 91 | +| UnitOfMeasureClass | Code | |
| 92 | +| UnitOfMeasure | Name | |
| 93 | +| UnitOfMeasureClass | Code | |
| 94 | +| AttributeCategory | Code | |
| 95 | +| AttributePicklist | Name | |
| 96 | +| AttributePicklistValue | Code | |
| 97 | +| AttributeDefinition | Code | |
| 98 | +| AttributeCategoryAttribute | AttributeCategory.Code, AttributeDefinition.Code | |
| 99 | +| ProductClassification | Code | |
| 100 | +| ProductClassificationAttr | AttributeDefinition.Code, ProductClassification.Code | |
| 101 | +| ProductSpecificationType | DeveloperName | |
| 102 | +| ProductSpecificationRecType | DeveloperName | |
| 103 | +| Product2 | StockKeepingUnit | |
| 104 | +| ProductAttributeDefinition | AttributeDefinitionId, Product2Id, ProductClassificationAttributeId | |
| 105 | +| Product2DataTranslation | Parent.StockKeepingUnit, Language | |
| 106 | +| CostBook | Name | |
| 107 | +| CostBookEntry | CostBook.Name, Product.StockKeepingUnit | |
| 108 | +| Pricebook2 | Name | |
| 109 | +| ProrationPolicy | Name | |
| 110 | +| ProductSellingModel | Name | |
| 111 | +| ProductSellingModelOption | ProductSellingModel.Name, Product2.StockKeepingUnit | |
| 112 | +| PricebookEntry | ProductSellingModel.Name, Product2.StockKeepingUnit, Pricebook2.Name | |
| 113 | +| ProductCatalog | Code | |
| 114 | +| ProductCategory | Code | |
| 115 | +| ProductCategoryDataTranslation | Parent.Code, Language | |
| 116 | +| ProductCategoryProduct | ProductCategory.Code, Product.StockKeepingUnit | |
| 117 | +| ProductComponentGroup | Code | |
| 118 | +| ProductComponentGrpOverride | OverrideContext.Name, ProductComponentGroup.Code | |
| 119 | +| ProductRelatedComponent | ParentProduct.StockKeepingUnit, ProductComponentGroup.Code, ProductRelationshipType.Name | |
| 120 | +| ProductRelComponentOverride | OverrideContext.Name, ProductRelatedComponentId | |
| 121 | +| PriceAdjustmentSchedule | Name | |
| 122 | +| PriceAdjustmentTier | PriceAdjustmentSchedule.Name, Product2.StockKeepingUnit | |
| 123 | +| BundleBasedAdjustment | PriceAdjustmentSchedule.Name, ParentProduct.StockKeepingUnit, Product.StockKeepingUnit | |
| 124 | +| AttributeBasedAdjRule | Name | |
| 125 | +| AttributeAdjustmentCondition | AttributeBasedAdjRule.Name, AttributeDefinition.Name, Product.StockKeepingUnit | |
| 126 | +| AttributeBasedAdjustment | AttributeBasedAdjRule.Name, PriceAdjustmentSchedule.Name, Product.StockKeepingUnit | |
| 127 | +| ProductConfigurationFlow | FlowIdentifier | |
| 128 | +| ProductConfigFlowAssignment | ProductConfigurationFlow.FlowIdentifier | |
| 129 | +
|
| 130 | +
|
| 131 | +--- |
| 132 | +
|
| 133 | +## Prerequisites |
| 134 | +
|
| 135 | +Before using these migration tools, ensure you have: |
| 136 | +- Digital Insurance product licenses configured in target orgs |
| 137 | +- Constraint Rule Engine enabled in target orgs (for CML migrations) |
| 138 | +- Appropriate API access and authentication credentials |
| 139 | +
|
| 140 | +--- |
| 141 | +
|
| 142 | +## Support and Troubleshooting |
| 143 | +
|
| 144 | +If you encounter issues during migration: |
| 145 | +- Check Failure/Skip log |
| 146 | +- Verify that all prerequisites are met in the target org |
| 147 | +- Ensure product model metadata exists before migrating dependent CML rules |
| 148 | +
|
| 149 | +For additional support, refer to the main repository documentation or contact Salesforce support. |
| 150 | +
|
| 151 | +--- |
| 152 | +
|
| 153 | +## Additional Resources |
| 154 | +
|
| 155 | +- [Main Repository README](../README.md) |
| 156 | +- [Example CML Rule Sets](../ExampleCMLRuleSets/README.md) |
| 157 | +- [Product Models Documentation](../ProductModels/README.md) |
| 158 | +
|
0 commit comments