{"title":"Move data from sandbox to production","slug":"migrating-from-sandbox","url":"https://support.storeconnect.com/articles/migrating-from-sandbox","url_markdown":"https://support.storeconnect.com/articles/migrating-from-sandbox.md","subtitle":null,"summary":"Export StoreConnect records from sandbox using a data loader, plan insertion order to handle dependencies, map External IDs, and import into your production org.","type":"Help_Documentation","video_url":"","keywords":"sandbox migration, production migration, data loader, external id, csv import, record dependencies, insert order, media migration, salesforce org migration, storeconnect objects, picklist values, org to org migration","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"Use this process to move StoreConnect records from a sandbox into production. The same approach works between any two Salesforce orgs.\n\n## Before you begin\n\n- Confirm the StoreConnect package version matches in both orgs. Check **Setup** \u003e **Installed Packages** in each. A version mismatch means fields may not exist in the target org.\n- Install a data loader that can export records and their relationships, such as [dataloader.io](https://dataloader.io/).\n- List every object you plan to migrate, using the [full list of StoreConnect objects](storeconnect-object-and-field-definitions) as your guide.\n- Plan the insert order around data dependencies before you export anything. See [plan the migration](#plan-the-migration) below and the [example insert order](#example-of-insert-order) at the end.\n\n:::warning\nSome things do not migrate and must be handled separately or by hand:\n\n- **StoreConnect settings metadata** can be exported, but you can only update those settings manually in the production org. See **Setup** \u003e **Custom Metadata Types**.\n- **Media files** move separately. See [media imports](#media-imports-from-the-storeconnect-cdn) below.\n- **Domains and mail addresses** should not be copied across. They differ between environments, and overwriting a production domain takes the live store down.\n- **Salesforce record IDs** from the sandbox do not exist in production. Never map a field containing a Salesforce ID to a lookup field in the target org.\n:::\n\n## Export recommendations\n\n- When exporting an object, include all its fields plus a unique identifier from any related objects. Use StoreConnect's External IDs to re-establish the links in the production org.\n- To keep the record owner on each record, export the **Username** field, then edit the export file to strip the `.{SandboxName}` suffix from the end of each username.\n\n## Export the StoreConnect external ID with records\n\nAll StoreConnect records have a StoreConnect External ID that is unique and can be used to help match imported records.\n\nIf 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. \n\n### Example: export trait records\n\nTrait records have a dependent relationship: every **Trait Type** belongs to a **Trait Category**, and **Trait Values** belong to a type. See [product traits](product-traits) for how the three fit together, and [apply product traits using templates](product-trait-templates) if your store also uses trait templates, which have their own records to migrate.\n\nTo relate each **Trait Type** to the correct **Trait Category**, include the **StoreConnect External ID** of each trait category in the export file.\n\n![Data loader field selection showing all fields selected for the trait export](https://res.cloudinary.com/hzkr6fi81/image/upload/v1725790539/knowledge/migrating-data/get-all-fields_qupina.png)\n\n![Data loader field selection showing the related trait category External ID added to the export](https://res.cloudinary.com/hzkr6fi81/image/upload/v1725790538/knowledge/migrating-data/get-related-id_vr1qq9.png)\n\n## Plan the migration\n\nImport objects in a logical order that accounts for dependencies such as custom lookups. Expect to test your first approach and adjust the plan.\n\n### Dependencies\n\nA dependency is where one object needs another to exist before its values can be imported. Identify these before you start.\n\nCircular dependencies need two passes. **Page** has a lookup to **Store**, and **Store** has lookups to **Page**. Insert the **Store** records first without mapping any lookups to **Page**, then insert the pages, then come back and update the store records with the page lookups.\n\nDo the same wherever records reference another record on the same object, such as **Page** and **Article Category**.\n\n### Record mapping in the CSV\n\nMap the exported data column by column, using the StoreConnect External ID as the reference where IDs must be maintained between objects.\n\nOptional identifier fields that do not need pre-populating, such as **Owner ID**, populate automatically if you leave them blank.\n\n![Data loader mapping screen showing Source Header, Sample Data, and Salesforce Field columns](https://res.cloudinary.com/hzkr6fi81/image/upload/v1725790574/knowledge/migrating-data/mapping_wtpfl0.png)\n\n**Source Header** is the column header in the export CSV, **Sample Data** is the value from the first record in that CSV, and **Salesforce Field** is the field you are mapping the column to in the production org.\n\n## Media imports from the StoreConnect CDN\n\nIf you use StoreConnect's content delivery network (CDN) to store and reference media, the production URLs need to point at production CDN files.\n\nIn the CSV, map the existing **URL** column to the **Import URL** field in your production org, and map nothing to the **URL** field. When **Import URL** has a value and **URL** is blank, StoreConnect generates the new URLs for you rather than you updating each one by hand.\n\n![Data loader mapping for media records, with the source URL column mapped to the Import URL field](https://res.cloudinary.com/hzkr6fi81/image/upload/v1725790571/knowledge/migrating-data/migrating-media_izrdcn.png)\n\n## Verify the migration\n\nOnce the import is complete, confirm it worked before you rely on the production org:\n\n1. Compare record counts per object between the two orgs, and account for any difference.\n2. Open a sample of records and confirm their lookups resolve to the right related records, rather than being blank or pointing at the wrong record.\n3. Open the production storefront and check that categories, products, prices, pages, and menus all render.\n4. Confirm media displays on product and content pages, which shows the CDN URLs generated correctly.\n5. Confirm each **Store** record still has its own production domain and has not been overwritten with the sandbox value.\n\n:::tip\nMake your next round of changes in the sandbox rather than production, particularly anything driven by an AI agent, then migrate it across using this process. See [build on StoreConnect using AI agents](use-ai-agents-with-storeconnect).\n:::\n\n## Tips and troubleshooting\n\n- **Missing picklist values.** Picklist values in the sandbox may not exist in production. Add them manually, then re-insert the records that failed.\n- **Duplication errors on products and price book entries.** StoreConnect's shipping and promotion products are added by the package at install time. They do not need importing or updating, so these errors are safe to ignore.\n- **Store domains.** When updating a **Store** record, do not overwrite the domain. It differs between the staging and production websites.\n- **Sending addresses.** Confirm each store's **Mail From Address** is set up as an [Organization-Wide Address](setting-up-storeconnect-emails) in the production org.\n\n## Example of insert order\n\nThis is a guide only. Build your own insert order to account for the data and field dependencies in your org.\n\n1. `Pricebook2`\n2. `Media__c`\n3. `Country__c`\n4. `Zone__c`\n5. `Zone_Country__c`\n6. `Tax__c`\n7. `Content_Block__c`\n8. `Content_Blocks_Children__c`\n9. `Trait_Category__c`\n10. `Trait_Type__c`\n11. `Trait_Value__c`\n12. `Stock_Location__c`\n13. `Store__c`\n14. `Transactional_Email__c`\n15. `Shipping_Provider__c`\n16. `Payment_Provider__c`\n17. `Shipping_Rate__c`\n18. `Taxonomy__c`\n19. `Product_Category__c`\n20. `Product_Category_Hierarchy__c`\n21. `Content_Blocks_Product_Categories__c`\n22. `Page__c`\n23. `Content_Blocks_Pages__c`\n24. `Article_Category__c`\n25. `Article__c`\n26. `Articles_Article_Categories__c`\n27. `Content_Blocks_Articles__c`\n28. `Product2`\n29. `PricebookEntry`\n30. `Products_Product_Categories__c`\n31. `Content_Blocks_Products__c`\n32. `Product_Media__c`\n33. `Product_Tax__c`\n34. `Product_Variant__c`\n35. `Related_Product__c`\n36. `Trait__c`"}