How to Migrate Vlocity Products between Salesforce Orgs

In Salesforce Industries, Products cannot be passed from one org to another with csv files. The solution is to migrate Vlocity Products using IDX Workbench.

Setup the IDX Workbench’s Workspace

  1. Install IDX Workbench if you haven’t already.
  2. Open IDX Workbench
migrate vlocity products idx workbench interface

The first time you launch IDX workbench, you have to set up the Workspace. If you have already used IDX Workbench between the orgs you’ll be migrating, skip to the next section.

  1. Click on the Pencil icon next to project
migrate vlocity products idx workbench new project or edit workspace
  1. On the Configure Workspace window, click on Repository and select New Repository
  1. In the New Repository window, set a name and select a folder in your computer.
    This folder will be used by the software for the migration and may or may not be used (but the software requires it).
migrate vlocity products idx workbench new repository dialog window
  1. Click on Source and choose New Environment. A new window will pop up.
  2. Set a name to identify the source Salesforce org and choose the appropriate type of login url
  • Choose login.salesforce.com for Production orgs
  • Choose test.salesforce.com for Sandbox orgs
migrate vlocity products idx workbench setting up new salesforce org as source
  1. Click on Log in using OAuth button at the bottom right corner.
    A Salesforce login page will open in your web browser
  2. Type in the credentials and log in
  3. An “Allow Access?” request for Salesforce CLI will pop up, click Allow.
migrate vlocity products idx workbench  allow access for salesforce CLI

The web browser will now load the org you’ve just logged in.

  1. Back in IDX workbench, click on Source and select the salesforce org you’ve just logged into with the name you’ve chosen
    It will show the username you logged into with a Salesforce Icon.
  1. Repeat the same process, (steps 6 through 12) to add the Target org instead of the Source.

Create a new IDX Workbench Project to Migrate Vlocity Products

  1. Click on Project and then click on New Project
migrate vlocity products idx workbench new project setup
  1. In the new window, type in a Name
migrate vlocity products idx workbench new project window
  1. Click on Vlocity Types, type in Product2 and select it.
migrate vlocity products idx workbench product2 vlocity types select project
  1.  Click on Fetch DataPacks button
migrate vlocity products idx workbench Edit project dialog window
  1. Select the Products2 folder and pass the selected Datapacks to the right column using the right arrow in the middle.
  2. Click Save and then Save again.

The datapacks will be retrieved, this might take a few minutes depending on how many products were selected.

migrate vlocity products idx workbench retrieving items from refresh

The datapacks will show on the left pane.

  • Yellow icons mean there are some changes when compared source and target org.
  • No Fill means unchanged
  • Green means it exists in the Source org but would be new in the Target org.

Generate Global keys before you start migration

Global Keys are necessary for Vlocity to identify and match elements in DataPacks. This is specially important to migrate Vlocity Products and and other elements from one org to another.

  1. From IDX Workbench, on the top menu, click Jobs
  2. Click on Ensure Global Keys in Source
  3. Wait until done

This will generate Global Keys for both, target and source (even though it says Source only)

migrate vlocity products idx workbench ensure global keys in source

Select the Products Layouts

Selecting the Product Layouts ensures that you migrate Vlocity products, their Object Types come with their inherited Layouts. For some reason, they aren’t selected as dependencies so they have to be selected aside.

  1. In the left pane, there’s 3 buttons, Collapse all, Expand and Filter
  1. Click on the first (from left to right) to collapse all to get a better view of all the items
  2. Check the box on the ObjectLayout folder
migrate vlocity products idx workbench select objectlayout from item list

The number of items on the ObjectLayout folder may vary in your org. I choose to just migrate the folder with all the ObjectLayouts and dependencies (which will bring all the UIfacets necessary). Why? Because it’s very difficult to go in and find out which one corresponds to the Object Types of the products you are migrating. 

If you can’t see all the folders, it might be because there’s a filtered view applied. The Filter icon shows up blue. Click on the filter icon and uncheck any filters.

migrate vlocity products idx workbench filter enabled

Select the Vlocity Products you’ll be exporting

  1. On the left pane, you’ll see a list of items (possibly expanded, collapse it just like in the previous step). Find the Product2 folder.

If you wish to copy all the Vlocity Products in the Source org, then check the box on the Product2 folder to mark all the Products for export.

migrate vlocity products idx workbench  items list collapsed

If you wish to only export certain Vlocity product(s), then expand the Product2 folder and check the ones you wish to migrate.

migrate vlocity products idx workbench full product2 display list

If you can’t see all the products in the list: right click on the Products2 folder and select Refresh 

migrate vlocity products idx workbench refresh all product2

If the product(s) you want to migrate still don’t show up, make sure there are no filters applied.

View Additional information on items

If you click on the Migrate tab on the right you can see more information about the items before you migrate Vlocity products. And, if there are any differences between the items in Target and Source orgs, you can compare them in the Comparison tab.

vlocity products idx workbench comparison tab

Migrate Vlocity Products

  1. To begin migrating the selected Products and the ObjectLayout folder, click the blue Actions button on the bottom then click Migrate with dependencies. 
migrate vlocity products idx workbench vlocity migrate with dependencies products

This will migrate all the selected Vlocity Products along with their related dependencies:

vlocity migrate products idx workbench deploying products
  1. Once it’s done, go to the Target org and make sure that everything looks alright.

Congratulations, you have successfully copied Vlocity Products from one Salesforce Org to another!

“Migration Failed” errors

Missing Global Keys

missing global key vlocity product. Error message -- no match found for Product2.%vlocity_namespace%__objecttypeId__c - %vlocity_namespace%__globalkey__c=null (system code)
Error message -- no match found for Product2.%vlocity_namespace%__objecttypeId__c - %vlocity_namespace%__globalkey__c=null (system code)

If you get this error message, it’s because the Object Type of that Vlocity Product doesn’t have Global Keys. You must generate the Global Keys and then retry the Migration.

Vlocity uses Global keys to identify and match the elements you’re trying to migrate between orgs or repositories. You can generate them going into Vlocity CMT management and running the EPC job called Generate Global Keys. (see: How to generate Vlocity Global Keys)

Successful migration but Error Attempt to de-reference a null object

Vlocity Product details Error attempt to de-reference a null object

If you get this error, it could mean a number of things but it boils down to a missing/empty link in the backend of the product. In this case it probably means that you didn’t migrate the Object Type layout.

To confirm this is the problem:

  1. Go to Vlocity Objects and Object Types from the power launcher.
migrate vlocity products idx workbench vlocity objects and object types power launcher menu
  1. Open the Object type the Product(s) belong to
  2. Open the Layout Management tab

If you get an empty Layout, like this:

migrate vlocity products idx workbench empty object type product layout

and this Object Type has a layout like this in the source org:

migrate vlocity products idx workbench products layout

Then the problem is that the ObjectLayout folder was not imported.

To fix this, go back to IDX workbench and make sure you migrate the ObjectLayout folder. (see instructions above)

Was this article helpful?
YesNo