Move data from sandbox to production
On this page
The following procedures work for moving data between any organizations, as well as between sandbox and production.
Recommendations for a successful migration
-
Use a data loader app to export all relevant records and their relationships, like dataloader.io
-
Create a list of all objects you want to migrate using our full list of StoreConnect objects as a guide
-
Plan out the logical insertion order of records to respect data dependencies (see example list below)
-
Move media files separately
-
You can export StoreConnect settings metadata, but you can only update these settings manually in the production org. See Setup -> Custom Metadata Types.
-
Be careful about advanced copying settings like domains and mail addresses
-
Make sure the StoreConnect Package version is the same for both orgs. Check this from Setup -> Installed Packages
-
When exporting an object, include all fields from that object and a unique identifier from any related objects. For example, use StoreConnect’s unique External IDs to re-establish data links in the production org.
-
If you want to maintain the record owner for each record, use the Username field, then edit the record suffix in the export file to remove the .{SandboxName} from the end.
-
Avoid mapping any fields that contain Salesforce ID’s to Lookup fields in your production org as those Salesforce ID’s will likely not match any records there.
Export the StoreConnect external ID with records
All StoreConnect records have a StoreConnect External ID that is unique and can be used to help match imported records.
If you need to bring over non-StoreConnect objects, you will need a unique field to reference. You can use the Salesforce Record ID, or add a special text field to the object in the other org to hold that ID temporarily, until the migration is completed.
Example: export trait records
Trait records have a dependent relationship, where Trait Types relate to Trait Categories.
To ensure we relate the correct Trait Types to the Correct Trait Categories, we use the storeConnect External ID for each Trait Category and add it to the export file.


Plan the migration
It’s best to plan the migration to ensure the objects you import are added in a logical and systematic order, taking into account dependencies such as custom lookup lists, etc. You may need to test your initial approach and then update your plan to get it right.
Dependencies
Dependencies are where two objects rely on each other to exist before values can be imported. For example, the Stores object.
Pages have a lookup to Stores and Stores have lookups to Pages. In this scenario, you’ll need to insert the Store records without mapping any lookups to Pages. Then after Pages have been inserted, come back and update the Store records with the page lookups.
You’ll need to do the same for any objects where records reference another record from the same object, like Pages and Article Category.
Identify dependencies as part of migration planning.
Record mapping in the CSV
When mapping the exported data column by column, use the StoreConnect External ID as the reference object, if reference IDs must be maintained between objects. (See screen shot below).
Where unique identifier fields do not need to be pre-populated (such as Owner ID) that are optional, these will get populated automatically if left blank.
Tip: Don’t map any fields that contain Salesforce ID’s to Lookup fields in your production org as those Salesforce ID’s will not match any records.

The Source Header is the column header in the export CSV, Sample Data is data from the first record in the export CSV, and Salesforce Field is the field you want to map each column to in the production org.
Media imports from the StoreConnect CDN
If you use StoreConnect’s content delivery network (CDN) to store and reference media, you’ll also need to update the production URLs to point to production CDN files.
In the CSV, map the existing URL to the Import URL field in your production org. Don’t map any value to the URL field. When the Import URL field has a value, but the URL field is blank, StoreConnect inserts new URLs automatically in your production org, saving you from manually updating.

Tips and troubleshooting for data migration
-
Picklist values in the sandbox may not exist in production. If you get errors regarding missing picklist values, you will need to add them manually and then insert the records that failed.
-
If you get duplication errors when inserting products and price book entries, this might be because StoreConnect shipping and promotion products are added by the package on install. They do not need to be imported again or updated so you can ignore those errors.
-
If updating a Store record, make sure you do not overwrite the domain as this may be different between the staging website and the production website
-
Make sure each Store’s Mail From Address is setup as an Organization-Wide Address
Example of insert order
The following is a guide only. You may need to make your own insert order list for ensuring data and field dependencies are accounted for.
-
Pricebook2
-
Media__c
-
Country__c
-
Zone__c
-
Zone_Country__c
-
Tax__c
-
Content_Block__c
-
Content_Blocks_Children__c
-
Trait_Category__c
-
Trait_Type__c
-
Trait_Value__c
-
Stock_Location__c
-
Store__c
-
Transactional_Email__c
-
Shipping_Provider__c
-
Payment_Provider__c
-
Shipping_Rate__c
-
Taxonomy__c
-
Product_Category__c
-
Product_Category_Hierarchy__c
-
Content_Blocks_Product_Categories__c
-
Page__c
-
Content_Blocks_Pages__c
-
Article_Category__c
-
Article__c
-
Articles_Article_Categories__c
-
Content_Blocks_Articles__c
-
Product2
-
PricebookEntry
-
Products_Product_Categories__c
-
Content_Blocks_Products__c
-
Product_Media__c
-
Product_Tax__c
-
Product_Variant__c
-
Related_Product__c
-
Trait__c