Resources /
Blog

Zero Downtime Data Migration in Salesforce: Is It Possible?

Submit your details to get a book

8
Min Read
Resources /
Blog

Zero Downtime Data Migration in Salesforce: Is It Possible?

Download

Submit your details to get a book

8
Min Read
Glowing data panel on a platform, linked to transfer, database, clock, list and check tiles
Glowing data panel on a platform, linked to transfer, database, clock, list and check tiles

Close to it, though a large Salesforce load always has some effect on the org. Salesforce's own guidance on loading data is about how to keep the impact small, and it never promises none.

Users feel three things during a load. Parallel batches can cause lock contention on records, sharing rules recalculate as records arrive, and triggers and workflow add processing time.

Your real target is a short cutover window that users hear about ahead of time, which is about as close to zero downtime data migration as Salesforce gets. Below, we walk through what causes downtime, how to plan the cutover and which Salesforce tools help at each step.

What does zero downtime mean for a Salesforce data migration?

In this post, zero downtime means users keep working and integrations keep running while data moves into the target org. We count it as zero downtime if people can still open, edit and trust the records they need while the load runs.

Zero downtime is also different from the platform being reachable. A migration can leave Salesforce online while an account is locked mid-load, a sharing recalculation delays access, or a half-loaded object shows incomplete data.

This post sticks to downtime. Schema changes, field mapping and validation belong to the wider plan in our guide to Salesforce data migration best practices and our tips for the data migration process.

Why do Salesforce data moves cause downtime?

Four parts of the platform turn a background load into something users notice. The table below lists each one with what Salesforce's documentation says about it.

Source of downtime riskWhat Salesforce's docs sayEffect on the migration
Parallel batchesParallel mode is the default and can cause lock contention on recordsRecords that can't get a lock are marked as failed and must be resubmitted
Lock-heavy operationsCreating users, updating ownership on records with private sharing, updating roles and updating territory hierarchies likely need serial modeSerial mode lowers lock risk but increases processing time
Sharing calculationsWith a Private sharing model, sharing is calculated as records are addedLoads run slower unless sharing work is deferred
Triggers and workflowSalesforce doesn't recommend large batches for objects with complex triggersRewrite trigger logic as batch Apex that runs after the load

Record locks

Salesforce gives its own example. When an AccountTeamMember record is created or updated, its account is locked during the transaction, so many batches that reference the same account are likely to hit a lock timeout.

Bulk API doesn't fail at once when it meets a lock; it waits a few seconds for the release, then marks the record as failed. Salesforce retries a failing batch up to 10 times, and after that it's marked as failed for good.

The fix Salesforce suggests is ordering, not just slowing down. Group child records by parent, such as AccountTeamMember records by AccountId, so all records for one account sit in a single batch.

Serial mode comes in when grouping by parent still leaves lock errors. Bulk API 2.0 currently supports only parallel mode, so a serial job means using the original Bulk API and setting concurrencyMode on the job.

Sharing calculations

Sharing rules add work to every insert. If ownership-based or criteria-based sharing rules exist before the load, each matching record requires sharing calculations as it's inserted.

Salesforce offers a way around this. An admin can defer sharing calculations for sharing rules and group membership, then resume them "during an organization's maintenance period."

The feature isn't on by default. You enable it by contacting Salesforce Customer Support, and it's available in Enterprise, Performance, Unlimited and Developer Editions.

Automation and validation

Validation rules, workflow rules and triggers keep everyday data clean. Trailhead warns they can slow inserts to a crawl during massive loads, and its approach is to set those rules to inactive for the load.

Triggers need preparation first. Trailhead's method is a custom setting with a checkbox field that the trigger checks, so you can switch the trigger off and on by editing that field.

Limits shared with live integrations

Bulk API and Bulk API 2.0 share an allocation of 15,000 batches per rolling 24-hour period. Both APIs allow up to 150,000,000 uploaded records in that period.

Bulk processes also have their own CPU time limit on the Salesforce servers of 60,000 milliseconds. The same guide asks you to budget API use across every integration, so existing workloads won't be interrupted.

How do you plan a near-zero-downtime cutover?

The cutover is the moment the target environment becomes the system of record. The infographic below shows the five phases that keep it short.

Infographic of five cutover phases for a Salesforce data migration, from sandbox rehearsal to verification, with what to watch for in each

Each phase is covered in the steps below, along with what to watch for:

  • Rehearse the whole load in a Full sandbox and time each step
  • Backfill the lean data set early, with child records grouped by parent
  • Sync changes with upserts on an external ID until the cutover
  • Cut over in a short window with edits frozen
  • Verify the job results before you reopen to users

1. Rehearse in a Full sandbox

Salesforce says to always test your data loads in a sandbox first, because processing times can be different in production. A timed rehearsal tells you how long the real window needs to be.

Pick the sandbox type with care. Salesforce's sandbox guide says only Full sandboxes support performance testing, load testing and staging, and our post on Salesforce sandbox types compares them.

2. Backfill early and lean

Trailhead's advice for large migrations is to load lean, with only the data and configuration your key operations need. It also says to load as quickly as possible to reduce the scope of synchronization.

Some setup can't be deferred. Trailhead names three things to have in place before the load:

  • Parent records with master-detail children, since child records can't load without their parents
  • Record owners, who need to exist before their records load
  • The role hierarchy, since deferring it brings no benefit in almost all cases

Bulk API 2.0 creates batches for you. With the original Bulk API, Salesforce suggests starting at the maximum batch size of 10,000 records and adjusting, since smaller batches raise the risk of hitting the daily batch limit.

3. Sync changes until cutover

Records keep changing in the source system after the backfill, so delta loads use upsert. A Bulk API 2.0 upsert job names the external ID field it matches on, which must also be in the CSV data.

If the source is another Salesforce org, Change Data Capture publishes events for created, updated, deleted and undeleted records. That gives you near-real-time changes for replication instead of periodic exports and imports.

4. Cut over in a short, planned window

Agree the window with the business, and freeze edits to the objects being finished. Then run the last delta load, so the transition ends with the target environment holding the same data as the source.

Next comes the post-processing that Trailhead lists. Resuming any deferred sharing belongs in the same window:

  • Add lookup relationships and roll-up summary fields with Batch Apex or Bulk API
  • Reset the custom settings that switch your triggers off
  • Turn validation, workflow and assignment rules back on
  • Resume sharing calculations if you deferred them

5. Verify, then reopen

Bulk API keeps each ingest job's success, failed and unprocessed records for 7 days after the job completes. Check them before you send users back in.

Keep a way back as well. Take a backup before the window opens, following our Salesforce data backup and recovery strategy, and avoid hardDelete during cleanup, since records it deletes aren't stored in the Recycle Bin.

Which Salesforce tools fit each phase?

Data Loader is Salesforce's client application for bulk import and export. Its guide says it supports up to 150 million records when used with Bulk API 2.0 and writes detailed success and error log files in CSV format.

Its command-line interface, available on Windows only, can run automated batch operations for repeated delta loads. Bulk API 2.0 itself suits any data operation over 2,000 records, according to Salesforce's limits reference.

Deploy schema changes, such as new objects and fields, before the data that depends on them. Our process tips explain why metadata goes first.

Moving data between systems with transforms on the way is an ETL job. Our posts on Salesforce ETL and ETL vs ELT cover that side, and our sandbox seeding guide covers filling the rehearsal sandbox with test data.

Migration records also matter after go-live. Keep an audit trail of what moved and when, and see our guide to data version control for tracking record changes over time.

Where Flosum fits

Data Migrator runs as a Cloud App on Flosum-managed AWS or a VM you own, and data is encrypted at rest and in transit.

Failed records that must be resubmitted are what stretch a cutover window. Flosum Data Migrator reduces this risk with a cloud-built architecture that moves large, complex datasets in parallel while preserving referential integrity.

The product page adds: "Parent-child and cross-object relationships are automatically preserved during every migration or seeding job." It also says every migration and seeding job is logged, versioned and auditable.

For backups taken before the window, our guide to data backup methods compares the options.

FAQs

Is zero downtime data migration possible in Salesforce?

Near zero is a realistic goal, but literal zero rarely is. Bulk loads can lock records users are working on, so plan a short cutover window and rehearse it in a sandbox first.

Does Bulk API 2.0 support serial mode?

No. The Bulk API 2.0 job reference says only parallel mode is currently supported, so serial processing needs a job in the original Bulk API.

How do you stop triggers and validation rules from slowing a migration?

Set validation and workflow rules to inactive, and control triggers with a custom setting checkbox. Trailhead's large data volumes unit explains both, plus the post-processing to run once the data is in.

What does deferring sharing calculations do?

It suspends sharing rule and group membership recalculation so a large change doesn't run into long evaluations or timeouts. Salesforce Customer Support has to enable the feature first.

How many records can you load into Salesforce in a day?

Bulk API and Bulk API 2.0 allow up to 150,000,000 records per rolling 24-hour period. The 15,000-batch allocation behind that figure is shared by both APIs.

Book a demo to see how Flosum Data Migrator moves Salesforce data between orgs with relationships intact.

Table Of Contents
Author
Stay Up-to-Date
Get flosum.com news in your inbox.

Thank you for subscribing

Ship Salesforce changes faster
See how City and County of Denver cut routine deployments from up to 2 days to under 15 minutes.
Free to start  |  No credit card required