Data migration moves Salesforce records from one org or system to another while keeping the records connected: accounts with their contacts and opportunities, cases with their activities, custom objects with their lookups. Migrations happen when seeding sandboxes, merging or splitting orgs, archiving data, and moving off legacy systems. Loading a flat file into one object is easy. Loading related objects so every relationship points to the right record in the destination is the hard part.
What Makes Data Migration Hard
- Relationships. Record IDs differ in the destination, so every lookup and master-detail field must be reconnected to the new records.
- Repeat loads. Migrations run more than once, and a second run must update the records from the first run instead of creating duplicates.
- Schema differences. Field names, picklist values, and record types may differ between source and destination.
- Automation and rules. Triggers, flows, and validation rules fire during the load.
- Volume. Large objects need to be split into manageable batches.
How to Approach a Migration
- Deploy the schema first. Objects, fields, and picklist values must exist in the destination before data arrives.
- Select records with their children, so related records travel together.
- Choose matching fields, ideally external IDs, so repeat loads update existing records.
- Map differences, such as renamed fields and changed picklist values.
- Load parents before children, with junction objects last, and pause automation that should not run.
- Verify record and reference counts, then spot-check relationships in the destination.
How Snapshot Helps
- Build Datasets: downloads related records into a local dataset with relationships preserved. Choose parents with Select All, Select By Name, Select With Filter, Select With SOQL, or Select Random Set, add related children with Child Record Limits, and use Estimate Dataset Size before building. Prebuilt templates include managed package templates.
- Manage Datasets: imports CSV or XML, remaps field names and values with Remap Fields, adds external ID fields, splits large objects with Range Cutter, and compares datasets for missing and changed records. Object Overview compares record and reference counts across orgs.
- Migrate Datasets: loads a dataset with Matching Fields for records and external references, VirtualId mappings for later runs, Scramble Fields and Data Transforms for sensitive values, and Deactivate Assets to pause automation. Choose Upsert Records Only, Delete Then Upsert, or Delete Records Only.
Counts alone do not establish correct relationships, and a halted load does not undo records already loaded.
Metadata Types Involved
-
CustomObject: the objects that must exist in the destination before records load. -
CustomField: fields, including external ID fields used for matching.
Common Questions
How do I keep relationships intact when moving records?
Move parents and children together, then reconnect each lookup to the matching destination record, using external IDs or recorded source-to-destination mappings.
How do I avoid duplicates on a second load?
Match destination records on fields that uniquely identify each record, so the second load updates records the first load created. Unexpected inserts on a repeat load signal unreliable matching.
In what order should objects be loaded?
Parents before children, with junction objects last, after all schema and picklist values exist in the destination.