Andrew Hanna

Andrew Hanna

Salesforce Data Migration Best Practices: Treat Data Like a Release

Salesforce Data Migration Best Practices: Treat Data Like a Release

The short answer: good Salesforce data migrations clean and map data before moving it, load owners and parents before children using external IDs, suspend automation during the load, mask personal data before it reaches a sandbox, and validate the result. The practice most guides skip is the one that matters most for DevOps teams: run data through the same reviewable release flow as metadata, because moving data between orgs is not a one-off project. It happens every sprint.

What are the Salesforce data migration best practices that actually matter?

  1. Define scope and sign-off. Decide which objects and how much history move, and who approves. Archive what you do not need.
  2. Clean at the source. Merge duplicates, fill required fields and make values match the target's picklists and validation rules.
  3. Map fields and owners. Every record needs a valid owner in the target org, including records owned by people who have left.
  4. Back up the target first. Capture a known-good state before you write to it.
  5. Load in dependency order. Users and owners, then parents, then children.
  6. Suspend what slows or corrupts the load. Triggers, validation rules and workflow, with a plan to switch them back on.
  7. Mask personal data before it lands anywhere outside production.
  8. Validate. Compare record counts, review failed rows and spot-check with reports.

Why is data migration a release problem, not a project?

Most best-practice guides describe one move from a legacy CRM into Salesforce. That happens once. What Salesforce teams do every week is move data between their own orgs: reference data for a new feature, test records for UAT, a refreshed sandbox that comes back empty. Done by hand with CSV exports, each run is an unreviewed change with no history.

Our view: if metadata goes through version control, review and a pipeline, the data that metadata depends on should too. A feature that ships without the configuration records behind it is a broken release, however clean the deploy log looks. We made that case for growing teams in scaling pains in DevOps and data management, and the same pipeline principles run through mastering Salesforce DevOps.

Which tool should you use for which load?

  • Data Import Wizard: built into Setup, up to 50,000 records at a time, for supported objects when the load does not need automating, per Trailhead.
  • Data Loader: a client app for 50,000 to 150 million records, objects the wizard does not support, and scheduled loads.
  • Bulk API: for scripted loads from a few thousand to millions of records.
  • Org-to-org DevOps tooling: moves data between orgs inside a deployment workflow instead of through files on a laptop.

For the full sequence of a first migration, see our step-by-step data migration guide.

How do you keep relationships intact across orgs?

Record IDs do not carry over between orgs, so a Contact's Account lookup from production points at nothing in a sandbox. Give every source record an external ID, upsert on it, and resolve lookups through it. Load owners and parents first: as the Trailhead large data volumes module notes, child records cannot load if their parents do not exist yet. External IDs also make reruns safe, because an upsert updates the record it already created instead of duplicating it.

Should you turn off automation during a data load?

Usually yes, and then turn it back on deliberately. Salesforce's guidance is to set validation and assignment rules inactive, switch triggers off with a custom setting, and, if you load under a Public Read/Write sharing model, defer sharing processing until after cutover. Afterwards, add lookups and roll-up summaries, reset the trigger switches and re-enable the rules. The risk is not the bypass. It is forgetting the re-enable step, which is why it belongs in a scripted, reviewable flow.

How do you move production data without leaking PII?

Mask it in transit, not afterwards. Copying real customer records into a sandbox and cleaning them later means they sat unmasked in an environment with wider access. Salesforce sells Data Mask & Seed for this. In Serpent, PII masking obfuscates common personal fields during preview and migration, so production-shaped data stays usable for testing while meeting GDPR and similar rules.

What does a data migration look like in Serpent?

  1. Open Migrate Data in the Data Management tab.
  2. Pick the source org and the destination org.
  3. Turn on PII masking if the data is leaving production.
  4. Start the migration, then review it on the Migration Details page, which shows the execution timeline. The Migrated Objects table filters by success and failed status.

Built-in dependency checks reduce migration surprises, and because Migrate Data is an action in the visual automation flow builder, metadata and data move in the same release flow. Sandbox seeding runs as part of environment setup and release pipelines, so refreshed sandboxes and scratch orgs come back populated without a manual script run. Full steps are in the data migration and masking guide, and the data deployment overview shows where it sits in the pipeline.

Take a backup before you write. The Backups view captures a known-good state and keeps a Restore History. It complements rollback, which reverses a release, because data is harder to reverse cleanly than metadata. See backup and restore. Deploy data is on every plan, including the free Essentials plan, and backup and restore starts on Scale.

FAQ

Why do child records fail to load in a Salesforce migration?

Usually the parent record or the owner does not exist in the target org yet. Load owners and parents first and resolve lookups through external IDs.

Should I use Data Loader or the Data Import Wizard?

The wizard suits loads under 50,000 records on supported objects. Data Loader handles up to 150 million records and scheduled loads.

Should sandboxes hold real production data?

Only masked. Mask personal fields during the migration so unmasked records never reach a lower environment.

Can a Salesforce data migration be rolled back?

Not as cleanly as metadata. Back up the target before the load so you can restore a known-good state.

Serpent moves data and metadata in one release flow, with masking and backups built in. If your team still migrates data by CSV, start with data deployment.

Related Articles

Curious about faster shipping before you dive in? Let's talk

Commitment free!