---
schema_version: "1"
id: e124eafea294f228bf64781029dad5bdf046576f94fa11f66a4dd2586db567b6
title: Migrate Context Rules Between Environments
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_migrate_context_rules_between_environments.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bb9a63d56faab60da1b94db38dd5cbfd23cbb706c239014ecafe8399fa06384a
description: You can migrate context rules from one environment to another, for example from a Sandbox environment to a Production environment.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Migrate Context Rules Between Environments

You can migrate context rules from one environment to another, for example from a Sandbox environment to a Production environment.

You can also migrate context rules using IDX Workbench. See

The migration process migrates all data related to context rules, including:

- Functions
- Context Actions
- Context Dimensions
- Context Scopes
- Object Level Rules
- Rule Sets

You can migrate context rule data using the DataPack Export functionality, which is invoked by the URL to the **DataPack Home** Visualforce page.

The following input parameters must be appended to the URL:

- DataPack name \[ Rule | ContextDimension \]
- Record ID for a rule or context dimension

For example:

`apex/DataPacksHome?exportDataPackType=<data-pack-name>&exportData=<record-ID>`

Example URL for context rule export:

`apex/DataPacksHome?exportDataPackType=Rule&exportData=a2b46000000dsxM`

Example URL for context dimension export:

`apex/DataPacksHome?exportDataPackType=ContextDimension&exportData=a3441000000S5BA`

You must export each context rule and context dimension individually. Once exported, you can create a multi-pack to bulk import all context rules and context dimensions at the same time.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/images/icon_note.png)

Note

At this time, the export of multiple context rules or context dimensions is not supported.

To migrate context rules, perform the following tasks:

1. [Export Context Rules](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "You must export each context rule individually as a JSON file. After exporting all rules, you can bulk import them to another environment using a DataPack.")
2. [Export Context Dimensions](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "You must export each context dimension individually as a JSON file. After exporting all context dimensions, you can bulk import them to another environment using a DataPack.")
3. [Create a MultiPack](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "Once you have exported all context rules and context dimensions, to import all rules and dimensions to another environment at the same time, create a multipack.")
4. [Import the MultiPack with Context Rules and Context Dimensions to a Different Environment](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "Once you have created a multipack with Context Rules and Context Dimensions, you can import it to a different environment.")

## Export Context Rules

You must export each context rule individually as a JSON file. After exporting all rules, you can bulk import them to another environment using a DataPack.

This task is a step in the [Migration of Context Rules Between Environments](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "You can migrate context rules from one environment to another, for example from a Sandbox environment to a Production environment.") process.

1. In the **All Tabs** page, click the **Vlocity Rules** link.
2. Create a view that displays only context rules.
3. Click the name of a rule you wish to export.
4. In the browser URL line, copy the ID of the context rule.
    
    ![The context rule Id is in the browser URL following the org hostname.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_rules_migration.jpg)
5. Append the ID to the rule export URL. The URL format is:
    
    ```
    https://hostname/apex/DataPacksHome?exportDataPackType=Rule&exportData=ContextRuleId
    ```
    
    For example:
    
    ```
    https://acme.visual.force.com/apex/DataPacksHome?exportDataPackType=Rule&exportData=a2I41000001qPRd
    ```
    
    ![Figure is described in the preceding text.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_rules_migration2.jpg)
6. Click **Enter**. The **Export DataPack** dialog box appears.
    
    ![The Export DataPack dialog lists a Rule and an EntityFilter.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_rules_migration1.jpg)
7. Click **Next**, **Next**.
8. Enter the name for the context rule.
9. Click **Done**.
    
    A JSON file is downloaded to your Downloads folder.
10. Repeat Steps 1 - 9 for each additional context rule you wish to export.

## Export Context Dimensions

You must export each context dimension individually as a JSON file. After exporting all context dimensions, you can bulk import them to another environment using a DataPack.

This task is a step in the [Migration of Context Rules Between Environments](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "You can migrate context rules from one environment to another, for example from a Sandbox environment to a Production environment.") process.

1. In the **All Tabs** page, click the **Vlocity Context Dimensions** link.
    
    The **Vlocity Context Dimensions** pages displays all existing context dimensions.
2. Click the name of a context dimension you wish to export.
3. In the browser URL line, copy the ID of the context dimension.
    
    ![The context dimension Id is in the browser URL following the org hostname.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_dimention_migration.jpg)
4. Append the ID to the rule export URL. The URL format is:
    
    ```
    https://hostname/apex/DataPacksHome?exportDataPackType=ContextDimension&exportData=ContextDimensionId
    ```
    
    For example:
    
    ```
    https://acme.visual.force.com/apex/DataPacksHome?exportDataPackType=ContextDimension&exportData=a3441000000S5BA
    ```
    
    ![Figure is described in the preceding text.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_dimention_migration1.jpg)
5. Click **Enter**.
    
    The **Export DataPack** dialog box appears.
    
    ![The Export DataPack dialog lists a Context dimension and a Context Scope.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_dimention_migration2.jpg)
6. Click **Next**, **Next**.
7. Enter the name for the context dimension.
8. Click **Done**.
    
    A JSON file is downloaded to your Downloads folder.
9. Repeat Steps 1 - 8 for each additional context dimension you wish to export.

## Create a MultiPack

Once you have exported all context rules and context dimensions, to import all rules and dimensions to another environment at the same time, create a multipack.

This task is a step in the [Migration of Context Rules Between Environments](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "You can migrate context rules from one environment to another, for example from a Sandbox environment to a Production environment.") process.

1. In the source environment, the All Tabs page, click the Vlocity DataPacks link.
    
    For each context rule and context dimension, a data pack is created and listed in the Vlocity DataPacks page. Use the **Last Modified** column to view a list of recently created datapacks.
2. Click each data pack you wish to import to expand it and select the checkbox.
    
    ![The Vlocity DataPacks page lists Context Dimension and Rule DataPacks. Each is expanded and its component check boxes are checked.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-comms_media_energy_managed-264-0-0-production-enus/ff4079f6-a384-475c-b863-578bbbb0ef9b/resources-product/images/context_rules_migration3.jpg)
3. Click **Create MultiPack**.
4. Enter the name for the multipack and click **Next**, **Next**, and **Done**.
    
    A JSON file with the same name is created and downloaded to your Downloads folder.

## Import the MultiPack to a Different Environment

Once you have created a multipack with Context Rules and Context Dimensions, you can import it to a different environment.

This task is a step in the [Migration of Context Rules Between Environments](https://help.salesforce.com/s/articleView?id=ind.comms_migrate_context_rules_between_environments.htm&release=264.0.0&type=5 "You can migrate context rules from one environment to another, for example from a Sandbox environment to a Production environment.") process.

1. In the source environment, the **All Tabs** page, click the **Vlocity DataPacks** link.
2. Click the **Installed** tab.
3. Click **Import From File**.
4. Browse to the location of the multipack JSON file, which is located in the Downloads folder by default.
5. Select the file.
6. Click **Next**, **Next**, **Next**, and **Done**.