DataMasker Configuration Migration Between Orgs

Updated on March 20, 2023

Overview

DataMasker is initially installed in a full-copy sandbox, once the testing is completed, DataMasker is installed and configured in Production Org. This way the next time the full-copy Sandbox is refreshed DataMasker and all of its configurations are copied onto the Sandbox. This process requires DataMasker configurations to be migrated once from Salesforce Sandbox to Production Org. The first step of the data migration process is to extract the CSV files from the source org that contains the mapping data. Extraction can be done using Workbench. When the CSV files are ready, these files need to be imported into the destination org using Workbench.

DataMasker configuration is stored as records in the following Objects:

  1. Configuration
  2. Object Masking
  3. Pattern
  4. Field Masking

The first step of the data migration process is to extract the CSV files from the source org that contains the mapping data. Extraction can effortlessly be done using Workbench. When the CSV files are ready, these files need to be pushed into the destination org using Workbench. We illustrate this process in detail, below.

This document should be used only as a reference guide as every Org is different and has its unique objects and structure.

Prerequisites

Before starting the Data Migration process, the user needs to create a custom field (data type – Text) with the name “External Id” on the objects i.e. ‘Configurations’, ‘Object Masking’, and ‘Patterns’ in the destination Org. This custom field should be of type ‘Text’, Case Sensitive, and ‘Unique Record Identifier from an external system’.

1. Configuration

API Name : pcldm__Configuration__c

To create a CSV file, execute the appended SOQL from Workbench

SELECT Id, Name, pcldm__Attachments_Files__c, pcldm__Case_Comments__c, pcldm__Chatter__c, pcldm__Description__c, pcldm__Emails__c, pcldm__Events__c, pcldm__Field_History__c, pcldm__Is_Sandbox__c, pcldm__Notes__c, pcldm__Notify_User__c, pcldm__Select_Masking_Type__c, pcldm__Show_Advance_Configurations__c, pcldm__Tasks__c, pcldm__User_Email_ids__c FROM pcldm__Configuration__c

Import the CSV file in the destination Salesforce org using Workbench. 

Click on Data -> Insert then Select the object and CSV file that needs to be pushed to the destination org

Map Fields

  • Map ‘External_Id__c’ with ‘Id’
2. Object Masking

API Name : pcldm__Object_Masking__c

To create a CSV file, execute the appended SOQL from Workbench

SELECT Id, Name, pcldm__Active__c, pcldm__Batch_Size__c, pcldm__Configuration__c, pcldm__Count_of_Field_Masking__c, pcldm__External_Id__c, pcldm__Filter_Criteria__c, pcldm__Group__c, pcldm__Last_Runtime__c, pcldm__Object_API__c, pcldm__Object_Label__c, pcldm__Sequence__c, pcldm__Serial_Mode__c, pcldm__Use_Bulk_Api__c, RecordTypeId FROM pcldm__Object_Masking__c

Import the CSV file in the destination Salesforce org using Workbench.

Click on Data -> Insert then Select the object and CSV file that needs to be pushed to a destination.

Map Fields

  • ‘External_Id__c’ with ‘Id’
  • ‘pcldm__Configuration__c’ with Smart Look Field i.e ‘pcldm__Configuration__c.External_Id__c’.

Note: Change the RecordType Id in the CSV for Mask and Delete record type before inserting it from the workbench.

3. Pattern

API Name : pcldm__Pattern__c

DataMasker comes pre-packaged with many pattern records. To avoid duplication of Pattern records from source org to destination org user can delete the pattern records from the destination org. This way when patterns are migrated, no duplicates are created.

To create a CSV file, execute the appended SOQL from Workbench

SELECT Id,Name,pcldm__Data_Type__c,pcldm__Preview__c,pcldm__Type__c,pcldm__Value__c,RecordTypeId FROM pcldm__Pattern__c

Import the CSV file in the destination Salesforce org using Workbench.

Map Fields

  • Map ‘External_Id__c’ with ‘Id’

Note: Change the RecordType Id in the CSV for List and Regex record type before inserting it from the workbench.

4. Field Masking

API Name : pcldm__Field_Masking__c

To create a CSV file, execute the appended SOQL from Workbench

SELECT Id, Name, pcldm__Action__c, pcldm__Active__c, pcldm__External_Id__c, pcldm__Field_API__c, pcldm__Field_Label__c, pcldm__Field_Type__c, pcldm__Further_Action__c, pcldm__ObjectExternalId__c, pcldm__Object_Masking__c, pcldm__Pattern__c, pcldm__Value__c FROM pcldm__Field_Masking__c

Import the CSV file in the destination Salesforce org using Workbench.

Map Fields

  • ‘pcldm__Object_Masking__c’ with Smart Look Field i.e ‘pcldm__Object_Masking__c.External_Id__c’
  • ‘pcldm__Pattern__c’ with Smart Look Field i.e ‘pcldm__Pattern__c.External_Id’.

Note: Ensure the value of the field with the data type Date/Time is in the format ‘YYYY-MM-DD HH:MM: SS’

The below screenshot shows the first two mapping fields

The one below shows the third mapping field

Once all the records for the 4 objects are imported, verify the Configuration, Objects, Fields, and Patterns all look good.