Replicating objects between two Salesforce Orgs
  • 16 Jan 2023
  • 8 Minutes to read
  • Contributors
  • Dark
    Light

Replicating objects between two Salesforce Orgs

  • Dark
    Light

Overview

The Replication functionality enables you to replicate objects between two Salesforce org capable of replication. During the replication session, Vault reads the object from the replicated session and initiates the replication from the source to the target org.

Before You Begin

  1. Salesforce Org registered with Vault. 
  2. Backup configured for your Salesforce Org. [Learn More]
  3. At least one backup operation is triggered for your Salesforce Org in Vault.

How to do it?

  1. Login to your Vault account.
  2. Click on Replicate from the Vault dashboard page and click on Replicate Now.
  3. On the next screen, select your Salesforce Org.
  4. Next, select the Destination Org.
  5. Next, select the Replicate Source and its configuration from the drop-down.
  6. Based on the replicate source and configuration selection, the configured list will get displayed.
  7. For backup as the replicate source, you can select multiple backups for replication. However for archival/hierarchical backup, you can choose only one from the list.
  8. Click on either EZ Replicate or Selective Replicate.

EZ Replicate

Full replication copies everything from the source to the destination, including new, updated, and existing data.

  1. Select the backups/hierarchical/archival to replicate and click on the EZ Replicate button.
  2. The replicate checklists are displayed on the next pop-up screen, which must be considered before we proceed with the replicate operation. Click Got It to close the popup.
  3. On the next screen, you will need to:
    1. Enter the Replicate label of your choice or leave the auto-generated default label.
    2. Specify the Batch Size for components to retrieve records. 10K is the max batch size that you can set per batch. This option helps run large jobs exceeding normal processing limits. As per the Salesforce governor limit, you can deploy or retrieve up to 10,000 files at once or a max size of 40 MB. Using Batch Size, you can process records in batches to stay within platform limits. If you have a lot of records, processing records through batches are your best solution.
    3. Choose the recipients from the Email notification dropdown who should receive notifications whenever the action is performed. The currently logged-in recipient will automatically be checked by default.
    4. Next, you can select the criteria for the replicate to get performed:
      • Disable Workflows: On selection, all the workflows of the Salesforce objects will be deactivated, and the data will be transferred from the source to the destination sandbox. Once the replication is completed, workflows will get activated.
      • Disable Validation rules: Validation rules verify that the data a user enters in a record meets your specified criteria before the user can save the record. On selection, all the validation rules of the Salesforce objects will be deactivated, and the data will be transferred from the source to the destination sandbox. Once the replicate is done, validation rules will get activated.
      • Enable Serial Mode for Bulk API: Serial mode processes batch one at a time; however, it can increase the processing time for a load.
      • Disable Triggers: When working with data and metadata, you may want to disable triggers you have in place to guarantee a successful replicate operation. This feature disables Salesforce triggers only.  Any managed package triggers will not be disabled.
  4. The list of metadata and data objects replicated will be displayed for the last time before the replicate process begins. You will not have options to select individual objects as it is an entire replicate process.
  5. Click Replicate Now.

Selective Replicate

This option allows you to select specific metadata/data that gets replicated only to the target org.

  1. Select the backups/archival to replicate and click the Selective Replicate button.
  2. The next screen displays the metadata and data objects that will be replicated. From the list of Metadata and Data type components, the user needs to select the components (along with their member) that will get replicated.
  3. Under the Metadata tab, you can choose the metadata members for each metadata type.
  4. On the Data tab, you additionally have the below configurations:
    1. Schema: The Schema will allow you to view your selected object's corresponding child objects. With the most recent Vault 23.1 release, we improved the schema representation by showing one level of the child/parent objects at a time. The tree can now be expanded based on your selection rather than the entire tree, which speeds up the download of the schema data and improves the UI.
      You may notice in the schema view that some objects are auto-selected by default and cannot be unchecked. These are the child objects of its parent object, which will be replicated if its parent object is selected. However, for other objects which are related to the selected object in some other way, you may have the option to choose them manually for replication. A warning popup appears when you click the Save button, stating you must select the appropriate hierarchy for the replicate procedure, or the process will fail. Click OK to dismiss the popup notification and return to the previous screen.
    2. Mappings: Map your source fields to your destination fields. Any matching headers from your source fields and your destination fields map automatically.
    3. Records: View the list of records for the object selected. Here, you can choose the records you wish to replicate to the destination org. You also have the option of importing records from a CSV file. To upload the CSV, click the Choose File button in the top right corner of the screen.
  5. Next, click on either the Next or Replicate button. If you choose Next, you will be navigated to a new screen where you can add a new masking rule. Data masking refers to changing certain data elements within a data store so that the structure remains similar while the information is changed to protect sensitive information. It ensures that sensitive customer information is unavailable beyond the permitted production environment. 
  6. However, if you want to skip the masking steps, click Replicate.
  7. Let's create a masking rule before we conclude the replicate process. To do so, click on Next. Now, click on the New Masking Rule button available in the top right corner.
  8. In the Masking Form screen, do the following:
    • Select the object for masking and choose the field type (string, date, phone, etc.).
    • Choose the Masking Style:
      • Prefix: This option will add the character before the selected field name. For example, if the field value in source org is ABC, and the prefix masking value is kept as 123, then the final field value being deployed will be 123.ABC
      • Suffix: This option will add the character after the selected field name. For example, if the field value in source org is ABC, and the suffix masking value is kept as 123, then the final field value being deployed will be ABC.123
      • Substitution: This option will substitute the selected field name with the character you enter in the Masking Value field. For example, if the field value in source org is ABC, and the replace masking value is kept as 123, then the final field value being deployed will be 123
      • Random: This option helps mask the original value with a random value within a specified range. For example, if the field value in source org is ABC, and the random string length value is set to 7, then the deployed field value would be similar to 15d3aRG.
    • Choose the fields for which the masking will be applicable. 
    • Once done, click on the Add button.
  9. Now, click on the Replicate button.
  10. The following popup screen displays the restore checklists, which must be considered before we continue with the replicate operation. Click on Got It button to close the popup.  
  11. On the next screen, you will need to:
    1. On the next screen, enter the Replicate label of your choice or leave the auto-generated default label.
    2. Specify the batch size for components to retrieve records. 10K is the max batch size that you can set per batch. This option helps run large jobs that would exceed normal processing limits. As per the Salesforce governor limit, you can deploy or retrieve up to 10,000 files at once or a max size of 40 MB. Using Batch Size, you can process records in batches to stay within platform limits. If you have a lot of records, processing records through batches are your best solution.
    3. Choose the recipients from the Email notification dropdown who should receive notifications whenever the action is performed. The currently logged-in recipient will automatically be checked by default.
    4. Next, you can select the criteria for the replicate to get performed:
      • Disable Workflows: On selection, all the workflows of the Salesforce objects will be deactivated, and the data will be transferred from the source to the destination sandbox. Once the replication is completed, workflows will get activated.
      • Disable Validation rules: Validation rules verify that the data a user enters in a record meets your specified criteria before the user can save the record. On selection, all the validation rules of the Salesforce objects will be deactivated, and the data will be transferred from the source to the destination sandbox. Once the replicate is done, validation rules will get activated.
      • Enable Serial Mode for Bulk API: Serial mode processes batch one at a time; however, it can increase the processing time for a load.
      • Disable Triggers: When working with data and metadata, you may want to disable triggers you have in place to guarantee a successful replicate operation. This feature disables Salesforce triggers only.  Any managed package triggers will not be disabled.
  12. Click Replicate Now.
  13. You will be redirected to the Replicate Summary homepage, which will show you the progress of the replicate operation recently triggered.
  14. Click on the Replicate Label to view the list of metadata/data being replicated to the org. Click on Export to locally save the restored metadata/data info in CSV format.

    Replicate Summary

    For each Replicate activity triggered in Vault, you will find the below details:

    AttributeDescription
    LabelThe label name that you have assigned for your restore activity.
    Click on the label to find the list of successful/failed metadata and data members that are part of the restore operation. Also, you can export to save the restored metadata/data info in CSV format locally. 
    Backup InfoGet a snapshot of your restore operation
    Date/TimeDate and time stamp for your restore operation
    DurationTotal time taken to complete the restore operation
    MetaSuccessTotal count of metadata objects that were successfully restored
    MetaFailureTotal count of metadata objects that failed to restore
    SuccessRecordsTotal count of data objects that were successfully restored
    FailedRecordsTotal count of data objects that failed to restore
    StatusRestore status (success or failed)
    Actions
    Additional actions:
    Restore summary: View the restore summary report
    Log: Find the log details for your restore operation
    Abort:  For an ongoing replicate operation, you can abort the process in between using the Abort icon.

Was this article helpful?

What's Next