# Migration Using Workbench

This guide walks you through migrating Grids between any Salesforce environments using Workbench.\
Whether you’re moving from a Developer Org, Scratch Org, Sandbox, or Production, the steps remain the same.

Our example uses a Production-to-Production migration, but the process applies to any combination of orgs.

## Prerequisites

1. **Salesforce Administrator Access**:\
   Ensure the user performing the migration has **System Administrator** privileges and the **Designer** role in Valorx Wave Embedded.
2. **Matching Package Versions**:\
   The installed **Valorx Wave Embedded** package version must be identical in both the source and destination Salesforce organizations.
3. **Data Migration Tool**:\
   Use a compatible data migration tool such as **MuleSoft**, **Copado**, or **Salesforce Inspector**. This document uses **Workbench** as an example.

## <mark style="color:red;">Important Notes</mark>

1. **Applicable Scope**:\
   The migration process is specific to **Wave Grids** only.
2. **Grid ID Changes**:\
   Wave Grid IDs will change during the migration process.
3. **Sharing Restrictions**:
   * Only grids not shared with other users are eligible for migration.
   * Grids with **global assignments** can be deployed.
   * Grids shared with specific users or using **custom grids** are not supported.
4. **Unsupported Features**:\
   Migration of **Related Grids** is not supported.

## Migration From Source Org

1. **Log in to the Source Salesforce Org**\
   Access the Salesforce organization where the grid is currently located.

2. **Open Valorx Wave**\
   Use the **App Launcher** to navigate to **Valorx Wave**.

3. **Locate the Grid**

   * Create a new grid or select an existing one from the **Wave Dashboard**.
   * Click **Edit** and copy the **Grid Name** from the **Grid Wizard**.

   <figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FFuN2K5WzRGjvAmjF2dRa%2FLocate%20Grid.gif?alt=media&#x26;token=4dc90f60-d91d-4302-b4da-0204464d0d6f" alt=""><figcaption><p>How to find Grid Name</p></figcaption></figure>

4. **Log in to the Data Migration Tools (Eg: Workbench)**\
   Use your source Salesforce Org credentials to log in to **Workbench**.

5. **Run the Query in Workbench**

   * Navigate to the **queries** section from the top menu bar.
   * Select **SOQL Query** from the dropdown.
   * Under **View As**, choose **Bulk CSV**.

   <figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2Ff7H9XtIQthVD4Iq1eGrN%2FLogin%20Workbench.gif?alt=media&#x26;token=f2d49f1c-4931-4847-be68-1547c424558a" alt=""><figcaption></figcaption></figure>

6. **Paste and Customize the Query**
   * Copy and paste the following query into the query box:

     ```sql
     SELECT valorxwave__API_Name__c, valorxwave__Description__c, 
     valorxwave__Display_Option__c, valorxwave__fields__c, 
     valorxwave__Is_Publicly_Accessible__c, valorxwave__Label__c, 
     valorxwave__Object_Name__c, valorxwave__query__c, 
     valorxwave__Settings__c, valorxwave__Type__c  
     FROM valorxwave__view__C  
     WHERE valorxwave__Type__c = 'GLOBAL' AND
     valorxwave__Label__c IN ('YOUR_GRID_NAME_1', 'YOUR_GRID_NAME_2')  
     ```
   * Replace `YOUR_GRID_NAME_1` with the grid name copied from the Global View Name. If migrating multiple grids, add grid names as **comma-separated values** (e.g., `'Grid_Name_1', 'Grid_Name_2'`).

7. **Execute the Query**

   * Click **Query** to run the query.
   * If no results are returned, ensure that the grid is permitted for export and not a custom grid.

   <figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FfC645S7PnLBbjxhs19cK%2FPaste%20the%20SQL%20into%20Query.gif?alt=media&#x26;token=52658a6b-5364-41bb-802d-69d7c52323b5" alt=""><figcaption></figcaption></figure>

8. **Download the Results**
   * Once the query is executed successfully, click the **Download** icon to save the results as a CSV file.

9. **Prepare for Target Org Import**

   * Log out from Workbench.
   * Log in again using the **target Salesforce Org credentials** to prepare for importing the data.

   <figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FruN0t5o21U9xrHTr97GN%2FDownload%20and%20Logout.gif?alt=media&#x26;token=f154fc1f-077b-42d1-9108-57a0c9e47827" alt=""><figcaption></figcaption></figure>

## Migration to Target Org

1. **Access Data Import in Workbench**
   * From the top menu bar, click **data** and select **Insert**.
   * Set the **Object Type** to `valorxwave__View__c`.
2. **Upload the Exported File**
   * Select **From File** and upload the CSV file exported from the source org.
3. **Map and Insert Data**
   * Click **Next** to proceed.
   * Map the fields as required and click **Confirm Insert** to start the data import process.
4. **Verify Insert Status**

   * Check the results. If you see **Result: Success** and **Status: Created**, the Wave Grid has been successfully migrated.

   <figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2Fryeqfk5EjO6w3LUjsSDf%2FNew%20Target.gif?alt=media&#x26;token=a400aa02-d991-4b6c-876a-f2c117de9ad1" alt=""><figcaption></figcaption></figure>

## After Successful Migration

1. **Log in to the Target Salesforce Org**
   * Use your credentials for the target org.
2. **Access Valorx Wave**
   * Navigate to **App Launcher**, search for **Valorx Wave**, and open the application.
3. **Verify the Migrated Grid**

   * The migrated grid should now be visible on the **Wave Dashboard**.

   <div><figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FzqZSHk2nzQJtDSanDlR3%2FBefore.png?alt=media&#x26;token=53c15c77-0e47-44e0-ae3c-69231ae5b0fa" alt=""><figcaption><p>Before Migrating Grid</p></figcaption></figure> <figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FrIg04aIgY0lQ5yA1P3gz%2FAfter.png?alt=media&#x26;token=0c46efaf-d43a-4c07-b9ce-9c1312dd81ee" alt=""><figcaption><p>After Migrating Grid</p></figcaption></figure></div>
