Launched:self-serve migrations intoSuperhuman Docs (Coda)
Try it now
01Agent-first
Runs where you already work
Plug it into Claude, ChatGPT or Cursor. Describe the move in plain English; the agent runs it.
02Engineer-led
Our production engine, unlocked
The pipeline our engineers use on managed enterprise migrations — the same code, now something you can drive yourself.
03Pricing
Try 10 pages free, then $1 a page
Credit-based, pay-as-you-go. No scoping call, no quote — sample it on your own docs before you spend anything.
04Sources
NotionSlabConfluenceSoonGoogle DocsSoon
Skip to content

Delta Migration: How to Re-Run Without Creating Duplicates

A re-run creates duplicates when the load has no ID map. Learn how external IDs, frozen mappings, and delta syncs make a migration safely re-runnable.

Roopendra Talekar Roopendra Talekar · · 21 min read
Delta Migration: How to Re-Run Without Creating Duplicates
TALK TO AN ENGINEER

Planning a migration?

Get a free 30-min call with our engineers. We'll review your setup and map out a custom migration plan — no obligation.

Schedule a free call
  • 1,500+ migrations completed
  • Zero downtime guaranteed
  • Transparent, fixed pricing
  • Project success responsibility
  • Post-migration support included

Self-serve? Start with ClonePartner Express, free sample first

Delta Migration: How to Re-Run Without Creating Duplicates

A re-run of a data migration is only safe when every record written to the destination is tied back to its source ID in a persistent map, and the load upserts on that key. Without that map, a second run — whether from a script, an import tool, or an AI agent working from a fresh prompt — treats every record as new and doubles your dataset.

This article covers why that happens, how an ID map and external ID fields prevent it, and how to run a clean delta sync that catches up the records created since your last bulk load. If your first bulk run already half-finished, read the engineer's triage guide first. This guide covers the next problem: how to catch up without creating duplicates.

What is a delta migration?

A delta migration is a follow-up run that copies only records created or changed in the source system since the last successful load. It is not a full re-run, and it is not just a retry queue for failed records. A retry replays rows that errored out; a delta re-queries the source for genuinely new or updated records and writes only that gap to the destination.

That distinction matters whenever the first bulk load ran days before go-live. Say the bulk load copied history last week, and agents kept replying to tickets and sales ops kept creating contacts since then. A retry-only tool can recover failed rows and still miss all of that new work. A delta sync closes that gap.

Why does re-running a migration create duplicate records?

Duplicate records after migration appear whenever the load process cannot determine that a record already exists in the destination. Five common patterns cause it.

Create-only endpoints

Most platform APIs default to a create path. Salesforce's standard POST /sobjects/Account always inserts, which is why Salesforce itself recommends upsert() over create() to avoid unwanted duplicates. (developer.salesforce.com) Zendesk's POST /api/v2/tickets creates a new ticket on every call. HubSpot deduplicates contacts automatically only by email, and companies created through the API are not deduplicated by domain. (knowledge.hubspot.com) Run the same payload twice on a create path with no unique key, and you get two records.

Retries after timeouts

Migrations move large data volumes, which frequently trigger API rate limits or gateway timeouts. If the destination committed the write but your client never saw the 201 response, a blind retry creates a second copy. Idempotency keys help only within a narrow window. Zendesk supports an Idempotency-Key header on ticket creation, but keys expire after two hours. A retry sent after that window creates a new ticket. (developer.zendesk.com)

A second session with no memory of the first

An AI agent connected through MCP, or a script kicked off from a fresh terminal, has no memory of what the previous session wrote. It reads the source, sees 10,000 contacts, and pushes all 10,000 — including the 6,000 it already created last time. The draft MCP specification describes the protocol as stateless: no state should be inferred from previous requests, and state that spans requests must be referenced by an explicit identifier the client passes each time. (github.com) So the migration state has to live somewhere outside the session. This is a common failure mode for agent-driven migrations: no persistent state between runs.

Contacts matched on a changed email

Some platforms use email as the default match key for people. HubSpot deduplicates contacts by email, and Zendesk's create-or-update user endpoint matches on email or external ID. If a contact's email changed in the source between the first run and the second, the destination sees a "new" contact. You now have two records for the same person — one with the old email and one with the new — and their activity history is split. HubSpot adds another edge case: importing with a secondary email and Record ID can replace the primary email on the existing contact, which makes matching on current email even more brittle. (knowledge.hubspot.com)

Key collisions from inconsistent normalization

Salesforce matches external IDs case-sensitively unless the field has the Unique attribute and the case-insensitive option selected. (developer.salesforce.com) If your first load wrote ACC-412 and your second load sends acc-412, Salesforce treats them as different values and creates a second record. The same class of problem appears anywhere your external key format is not strictly normalized before every write, for example ACC-00412 in one run and ACC-412 in the next.

Warning

Do not rely on a platform's native deduplication rules to save a poorly designed re-run. Many help desks and CRMs allow multiple contacts with the same name, or multiple tickets with the same subject line. The API will happily execute what you tell it to do.

What is an ID map and how does it prevent duplicates?

An ID map (also called a source-to-destination ID map or cross-reference table) is a persistent lookup that pairs every source record ID with the ID it received in the destination after the first successful write. It is the single piece of infrastructure that makes a migration re-runnable.

Before writing any record, the load process checks the map. If the source ID is already there, it updates (or skips) the destination record using the stored destination ID. If it is not there, it creates a new record and stores the returned ID. This is what makes a load idempotent — running it twice with the same input produces the same result, not twice the records.

A minimal ID map looks like this:

source_id  | destination_id | object_type | created_at
-----------+----------------+-------------+---------------------
FD-10421   | 448209371      | ticket      | 2026-11-15T08:12:03Z
FD-10422   | 448209372      | ticket      | 2026-11-15T08:12:04Z

A production map should also store: the mapping version applied during that write, the source updated_at timestamp at extraction time, the last successful run ID, and a checksum of the payload written. For parent-child data, the map must exist before child loads so children can resolve parents deterministically — Salesforce explicitly supports referencing parent records by external ID during upsert. (developer.salesforce.com)

Critically, the ID map write and the destination write must be treated as an atomic unit. If your process writes to the destination but crashes before updating the map, the next run will re-create the record and produce a duplicate. The safest pattern is to write the destination record, capture the returned ID, and persist it to the map within the same error-handling block — retrying the full unit on failure rather than assuming partial completion. For high-volume loads, write the map to a database with a transaction boundary around both operations, not to a flat file that can be partially written.

The map must live outside the migration script's memory and outside the AI agent's context window. A database table, a JSON file on disk, or a CSV checkpoint file all work. What does not work: a variable that only exists while the process is running, or a conversation history that gets truncated or starts fresh.

Concurrency risk: If two delta runs execute simultaneously — a scheduled job fires while a manual re-run is in progress — both may query the ID map, see a record as unmapped, and each attempt to create it. The result is a duplicate even with a correctly implemented map. Prevent this with a distributed lock (a database row-level lock, a Redis SETNX, or a file advisory lock) that only one process can hold. Log the lock acquisition so you have an audit trail if concurrent runs are suspected after the fact.

Warning

An ID map is not a cache. Never delete it until the migration project is fully closed, including all delta syncs. Losing the map mid-project means you cannot safely re-run, resume, or delta-sync without risking duplicates.

How do external ID fields work on the major platforms?

An external ID field is a platform-native field designed to hold identifiers from an outside system. When a platform's API supports upsert by external ID, the map is effectively enforced at the destination: send a record with an external ID that already exists, and the platform updates instead of creating. This is the strongest form of duplicate prevention because it does not depend on your script remembering what it wrote.

Salesforce external IDs

Salesforce lets you mark any custom text, number, or email field as an External ID. Upsert by external ID is a first-class API operation: send a PATCH to /sobjects/{Object}/{ExternalIdField}/{value} and Salesforce inserts if the value is new, updates if it matches one record, or returns HTTP 300 with the list of matching records if it matches more than one. (developer.salesforce.com)

Child records can reference parents by external ID during upsert, so you do not need to resolve parent destination IDs before loading children. Salesforce also supports an updateOnly=true parameter on the upsert URL. It stops the call from creating a record when no match exists, which is useful on a pass that should only update existing records.

For large loads, Bulk API 2.0 ingest jobs support the same upsert operation: you name the external ID field in the job's externalIdFieldName parameter. (developer.salesforce.com) Bulk jobs are asynchronous and process records in batches rather than one REST call per record.

Tip

Salesforce external ID matching is case-sensitive unless the field is Unique and set to treat "ABC" and "abc" as duplicate values. If your source IDs mix case (ACC-412 vs acc-412), choose that option when you create the field, or normalize before load.

HubSpot unique identifier properties

HubSpot's batch upsert endpoint (POST /crm/v3/objects/{objectType}/batch/upsert) accepts an idProperty parameter that tells the API which property to use as the dedup key. For contacts, this can be email or a custom unique identifier property. For other objects, it must be a custom unique property. HubSpot does not support partial upserts when email is the idProperty, so use a custom unique property if you need them. (developers.hubspot.com)

Three constraints to know:

  • HubSpot lets you require unique values only when you create the property, and allows up to ten unique value properties per object. (knowledge.hubspot.com) Plan the external ID field before your first load, not after.
  • For contacts, email still has special behavior in imports and automatic deduplication, so a dedicated migration key (e.g., legacy_source_id) is safer than relying on the current primary email to stay stable between runs.
  • Admins can add required properties or validation rules after your bulk load. A payload that passed during the bulk load can then fail in a later delta. Check destination metadata before every delta run and treat any drift as a change that needs a mapping review.

Zendesk external_id

Zendesk tickets, users, and organizations all carry an external_id field, but only users and organizations have an upsert endpoint that matches on it:

  • Ticket Import API (POST /api/v2/imports/tickets): The path you want for migrations, because it lets you set historical created_at, updated_at, and solved_at values. (developer.zendesk.com) It does not upsert on external_id. Each import call is a create.
  • Standard Tickets API (POST /api/v2/tickets): Also creates on every call. Zendesk says ticket external IDs do not have to be unique, so two tickets with the same external_id can exist side by side. You can list tickets by external ID with GET /api/v2/tickets?external_id={value} to check before a write. (developer.zendesk.com)
  • Users API (POST /api/v2/users/create_or_update): Updates an existing user matched by email or external ID, and creates one if there is no match. Zendesk treats user external IDs as case-insensitive. (developer.zendesk.com)
  • Organizations API (POST /api/v2/organizations/create_or_update): Matches on id or external_id, not on name. (developer.zendesk.com)
Danger

Zendesk has no upsert for tickets. A re-run that imports tickets without checking your ID map (or looking up the external ID first) creates a second copy of every ticket. Users and organizations are safer because their create_or_update endpoints match on external ID.

Platform comparison: external ID upsert support

Platform External ID field Upsert endpoint Gotcha
Salesforce Custom field marked External ID PATCH /sobjects/{Obj}/{Field}/{Value} Case-sensitive matching unless the field is Unique and case-insensitive; HTTP 300 on multiple matches
HubSpot email (contacts) or a custom property with unique values POST /crm/v3/objects/{type}/batch/upsert with idProperty Unique flag can only be set at property creation
Zendesk (tickets) external_id (not unique) None. Check the ID map, then POST /api/v2/imports/tickets Every import or create call makes a new ticket
Zendesk (users) external_id POST /api/v2/users/create_or_update Matches on email or external_id; external ID is case-insensitive
Zendesk (organizations) external_id POST /api/v2/organizations/create_or_update Matches on id or external_id, never on name

How to freeze the field mapping between runs

Freezing the field mapping means locking the source-to-destination field transformation rules so that every run — sample, full migration, and every delta sync — applies exactly the same logic. If the mapping changes between the bulk load and the delta, records updated during the delta may land with different field values than records loaded during the bulk, and your data looks inconsistent.

Schema drift is a common reason mappings silently break between runs. A destination admin adds a required field, renames a property, tightens a validation rule, or changes an enumeration's allowed values. A payload that passed validation during the bulk load now returns a 400 error or, worse, writes a default value silently into a field your mapping assumed would stay empty. Detect schema drift by polling the destination's metadata API before each delta run and diffing the result against the schema snapshot captured at bulk load time. Treat any diff as a blocking event: stop the delta, review the change, update the mapping file, re-run the sample, then proceed. Do not improvise around schema changes in production.

In practice, freeze four things: the field-to-field mapping, the transformation rules, the association logic (which source field drives which destination relationship), and the required-field assumptions in the destination.

  1. Define the mapping in a file, not in code comments or a prompt. A JSON or YAML mapping file that your migration script reads at runtime is auditable and diffable. A mapping embedded in a chat prompt is neither. Do not let an AI agent or script re-derive the mapping during a re-run. A mapping worked out again in a new session is a new mapping, and it has not been through sample sign-off.
  2. Review and sign off on the mapping after a sample migration. Run a small batch, validate the output field by field, then lock the mapping file. The sample run is exactly for this purpose.
  3. Version-control the mapping. Tag the mapping version in Git and store that tag in the ID map alongside each record written. If a change is needed after the full load starts, the diff tells you exactly what changed, and the ID map tells you which records need reprocessing.
  4. Use the same mapping for the delta. The delta sync is not a separate migration. It is the same pipeline, the same mapping, the same transformation logic — just filtered to records that changed since the last run.
Tip

If the mapping version changed, rerun the sample. Do not let the bulk run use one mapping and the Monday delta use another.

How does a delta sync select only changed records?

A delta sync queries the source for records where updated_at is after a known cutoff timestamp, then upserts only those records to the destination. The cutoff — called a high-water mark — must come from the last successful run, not the last attempted run. If you save the watermark after a failed attempt, the next delta skips records that never actually landed.

Timezone and clock skew handling

Store all high-water mark timestamps in UTC. If the source system returns timestamps in a local timezone (e.g., America/Chicago), normalize to UTC before storing the watermark and before constructing the delta query. Clock skew between the source system's NTP server and your extraction host can silently drop records: if the source clock is 90 seconds behind yours, records written in that 90-second window will have a modified_at timestamp that appears to predate your watermark. The standard mitigation is a buffer subtracted from the watermark (see below), but that buffer must exceed your maximum expected clock skew by a margin.

The mechanics

  1. Record a high-water mark after each validated run. When the bulk load finishes and passes validation at 2026-11-15T22:00:00Z UTC, store that timestamp.
  2. Include a buffer. Subtract 15 to 30 minutes from the high-water mark when querying for changes. This catches records that were in transit, delayed in the source system, or affected by clock skew during your initial extraction. Size the buffer to exceed your worst-case source clock skew.
  3. Extract only changed records. Query the source for records modified after your buffered timestamp.
  4. Look up each record in the ID map. If the source ID exists, update the stored destination record. If it does not, create a new record and add the pair to the map.
  5. Respect parent-before-child order. A new ticket that references a new organization must have the organization created first. The delta pipeline needs the same dependency resolution as the full load.
# Pseudocode: delta sync with ID map, error handling, and partial-failure recovery
# Assumes: distributed lock already acquired before this function is called
 
def run_delta_sync(source, destination, id_map, field_mapping, last_run_timestamp, buffer_minutes=30):
    cutoff = last_run_timestamp - timedelta(minutes=buffer_minutes)
    failed_records = []
 
    for record in source.get_modified_since(cutoff):
        try:
            transformed = transform(record, field_mapping)
            dest_id = id_map.lookup(record.source_id, record.object_type)
 
            if dest_id:
                destination.update(dest_id, transformed)
            else:
                # Persist the map entry immediately after the create returns,
                # inside the same error-handling unit as the write
                with id_map.transaction():
                    new_id = destination.create(transformed)
                    id_map.store(record.source_id, new_id, record.object_type,
                                 mapping_version=field_mapping.version,
                                 source_updated_at=record.updated_at)
 
        except RateLimitError as e:
            time.sleep(e.retry_after)
            # Re-queue this record
            failed_records.append(record)
 
        except PartialBatchError as e:
            # Log which items in the batch succeeded vs. failed
            for item_id, error in e.failed_items.items():
                log.error(f"Batch item {item_id} failed: {error}")
                failed_records.append(item_id)
            # Persist successful items to map before continuing
            for item_id, dest_id in e.succeeded_items.items():
                id_map.store(item_id, dest_id, record.object_type)
 
        except Exception as e:
            log.error(f"Unhandled error on {record.source_id}: {e}")
            failed_records.append(record)
 
    # Persist watermark only after validated completion
    if not failed_records:
        id_map.set_watermark(datetime.utcnow())
    else:
        log.warning(f"{len(failed_records)} records failed — watermark not advanced")
        raise DeltaIncompleteError(failed_records)
 
    return failed_records

The watermark is only advanced after a clean, validated run. If failures occur, the next delta will re-query from the previous watermark, catching the failed records again. This means failed records may be retried multiple times — your upsert logic must handle that without creating duplicates, which is exactly what the ID map lookup provides.

Platform-specific selectors

The exact query depends on the source platform:

  • Salesforce: getUpdated() returns IDs for records created or updated in a specified window, but only for up to 30 days before the call. (developer.salesforce.com) If your gap is longer, use a SOQL query with WHERE SystemModstamp > :lastRun. LastModifiedDate records when a user last modified the record, while SystemModstamp also changes when an automated process does. Even SystemModstamp does not capture every change, for example a value a record pulls from another object. (developer.salesforce.com)
  • HubSpot: The CRM search endpoint (POST /crm/v3/objects/{type}/search) can filter on the last-modified property with filterGroups. A page holds up to 200 results, one query can page through at most 10,000 results, and search is limited to five requests per second. Newly updated records can take a few moments to appear. (developers.hubspot.com) Split large deltas into narrower time windows.
  • Zendesk: Incremental exports return records changed after a given Unix timestamp. Zendesk recommends the cursor-based export (GET /api/v2/incremental/tickets/cursor.json?start_time={unix_time}). Ticket exports leave out the most recent minute, and time-based exports can return duplicate items across responses, so deduplicate on id plus updated_at before processing. (developer.zendesk.com) Incremental export endpoints have their own rate limit of 10 requests per minute, or 30 with the High Volume API add-on. (developer.zendesk.com)

Handle soft deletes

Default list calls and updated_at filters miss archived or soft-deleted records. If a user deleted a ticket in the source system between your bulk run and your delta run, that ticket's updated_at will not appear in a standard modified-records query on most platforms. You must explicitly query the source platform's deleted or archived records endpoint and issue corresponding delete or archive commands to the destination.

  • Salesforce: The queryAll resource returns records soft-deleted by a delete or merge, with IsDeleted set to true, until they are permanently removed from the Recycle Bin. (developer.salesforce.com)
  • HubSpot: Search never returns archived records. Use the list endpoint with archived=true, for example GET /crm/v3/objects/contacts?archived=true. (developers.hubspot.com)
  • Zendesk: Deleted tickets are listed by GET /api/v2/deleted_tickets. They stay in the Deleted tickets view for 30 days, then Zendesk deletes them permanently. (support.zendesk.com)

If your delta pipeline does not account for deletes, records deleted in the source accumulate as orphaned active records in the destination indefinitely.

Info

The delta approach works only if the source platform tracks modification dates reliably. Some legacy systems do not update a modified_at timestamp on all change types (e.g., adding a tag, changing a custom field value, or reassigning ownership). Test with real data before trusting the timestamp filter: make a known change in the source, wait two minutes, then query for modified records and confirm the changed record appears. If the source has no reliable change-tracking feed, evaluate CDC (change data capture) tools or accept wider overlap windows before promising a short cutover.

On platforms and objects with external ID upsert support (Salesforce, HubSpot, Zendesk users and organizations, but not Zendesk tickets), you can simplify the delta: instead of checking the ID map before each write, upsert every record by its external ID. The platform decides whether to create or update. The ID map still records the result, but the platform enforces idempotency.

How to clean up duplicates that already exist

If a re-run already created duplicates and the destination is live, do not drop everything and re-import. New live records mix with migrated ones, new internal IDs have been issued and linked to external systems, automations have fired, and emails have gone out. The goal is to merge duplicates into a single survivor record while preserving all associated history.

Step 1: Identify the duplicates

Export the destination records and group by the source ID (stored in the external ID field, or in your ID map). Any source ID that maps to more than one destination ID is a duplicate. If you did not store source IDs on the destination records, match on a combination of fields: name + email + created date, or subject + requester + timestamp for tickets.

Step 2: Isolate live work

Filter out any records where the created_at or updated_at timestamp is after the moment your team logged in and started working. You cannot safely delete these without destroying live customer interactions.

Step 3: Pick a survivor

For each duplicate group, designate one record as the survivor using a consistent, documented rule:

  • Oldest destination ID — if no one has edited either copy, the first-created record is usually correct.
  • Most complete data — if users have already started editing one copy, keep the one with more activity.
  • Most recent activity — sometimes the duplicate record has the latest updates because users found it first.

Document the rule and apply it consistently across all object types.

Step 4: Reparent child records and merge

Before deleting the duplicate, move its child records to the survivor.

Salesforce: The native merge() call works on leads, contacts, accounts, person accounts, and individuals. It keeps the main record, deletes the others, and makes the main record the new parent of their related records. One request merges at most three records, including the main record, so larger groups need successive merges into the same main record. Records deleted by a merge stay visible to queryAll() until they leave the Recycle Bin. (developer.salesforce.com)

HubSpot: Merging records brings timeline activities and associations from both records onto the merged record. The primary record's property values win where both have a value. The Merged [record] IDs property lets you audit which records were folded in. HubSpot cannot unmerge records, so pick the survivor carefully. (knowledge.hubspot.com)

Zendesk: The merge endpoint (POST /api/v2/tickets/{ticket_id}/merge) merges the tickets listed in ids into the target ticket as a background job, and copies their attachments to the target. (developer.zendesk.com) Duplicate end users merge with PUT /api/v2/users/{user_id}/merge. Agents, admins, and users who requested more than 10,000 tickets cannot be merged this way. (developer.zendesk.com) For large duplicate sets, script one merge call per duplicate group and pace the calls to your plan's API limit, which ranges from 200 requests per minute on Team to 700 on Enterprise. (developer.zendesk.com)

Step 5: Update the ID map

Remove or update the duplicate's entry in your ID map so the survivor is the only destination ID for that source record. If you skip this step, the next delta sync will not know which destination record to target and may create a third copy.

Most of the cost of a cleanup is engineering time, user disruption, and lost trust in the new system. It is always cheaper to build an ID map before the first run than to untangle duplicates after go-live.

The final delta and cutover

The cutover sequence brings the destination fully current and routes all work to the new system. When the ID map and field mapping are already in place from the bulk load, the final delta is a small, fast operation.

  1. Before go-live: Run the bulk historical load while the team keeps working in the old system. How long it takes depends on data volume, complexity, and API rate limits.
  2. In the days before cutover: Run one or more catch-up deltas to keep the gap small. Each one picks up what was created or modified since the previous run.
  3. Monday morning, before the team starts: Freeze the source system (disable new ticket creation, set the CRM to read-only, or communicate a freeze). Run the final delta sync. With the map and mapping in place, this run processes only records created or modified since the previous delta, and takes about 30 minutes.
  4. Validate: Run record-count parity checks between source and destination. Spot-check a sample of the delta records for field accuracy. Confirm that parent-child relationships survived. Verify that no soft-deleted source records appear as active in the destination.
  5. Go live: Point users, integrations, and automations to the new system. The source system remains intact as a backup.

The practical rule is simple: migration state has to live in the migration system — not in a prompt, not in a terminal session, and not in someone's memory. That is the real point of delta migration: not speed for its own sake, but a short, controlled cutover window where every record is accounted for and none is written twice.

Delta migration checklist

Verify these before pressing re-run.

Step What to do What breaks if you skip it
1. Create the external ID field Add and configure the field on the destination before any load No upsert path — every re-run creates duplicates
2. Build and persist the ID map Store source_id → destination_id pairs outside the script's memory The re-run guesses and creates duplicates
3. Treat ID map writes as atomic Write destination record and map entry in the same transaction or error-handling block Crash between write and map update produces untracked duplicates
4. Set external IDs on every record during bulk load Write the source system's ID into the destination's external ID field No lookup key for delta syncs or audits
5. Use upsert paths, or look up before you create Salesforce: PATCH by external ID. HubSpot: batch upsert with idProperty. Zendesk tickets: check the ID map, then Ticket Import API Create calls with no lookup always insert, never update
6. Acquire a distributed lock before each run Use a database row lock, Redis SETNX, or file advisory lock Concurrent runs both see unmapped records and each creates a duplicate
7. Freeze the field mapping Lock the mapping file so bulk, delta, and re-runs use identical logic Inconsistent field values between loads
8. Detect schema drift before each delta Poll destination metadata API and diff against bulk-load snapshot New required fields or changed validation cause silent bad writes
9. Store high-water marks in UTC Normalize all timestamps to UTC before saving the watermark Timezone and clock skew silently drop records near the boundary
10. Apply a timestamp buffer Subtract 15–30 min from the watermark when querying Records in transit or affected by clock skew during the previous run are permanently missed
11. Handle soft deletes explicitly Query source trash/archive endpoints; issue delete/archive commands to destination Deleted source records remain active in the destination indefinitely
12. Handle partial batch failures Log succeeded and failed items per batch; persist map entries for successes immediately Reprocessing an entire batch on retry creates duplicates for already-succeeded items
13. Advance watermark only on validated success Do not update the high-water mark if failures occurred A bad watermark causes the next delta to skip records that never landed
14. Validate after every run Record-count parity, field spot checks, referential integrity, soft-delete reconciliation Problems caught after go-live cost significantly more to fix
15. Run the final delta on Monday morning Freeze the source, sync the gap (about 30 minutes), validate, go live A gap between source freeze and destination readiness

Common failure modes: decision reference

Failure mode Root cause Detection Fix
Duplicate records after re-run No ID map or create-only endpoint Count destination records vs. source records Build ID map; switch to upsert endpoint
Records missed between runs Watermark saved after failed attempt Count records in source time window vs. destination Save watermark only on validated success; add buffer
Duplicate from concurrent runs No distributed lock Two entries in ID map for same source ID Add pre-run lock; merge duplicates
Field value inconsistency Mapping changed between runs Diff field values on sample records across load batches Version-control mapping; reprocess affected records
Deleted source records still active Soft deletes not queried Compare active destination records vs. source archived endpoint Query source trash explicitly; apply deletes to destination
Delta misses recent changes Source does not update modified_at for all change types Test: make a known change, verify it appears in modified-records query Expand overlap window; evaluate CDC; audit source change tracking
Clock skew drops boundary records Source and extraction host clocks diverge Inspect records near watermark boundary Increase buffer beyond maximum observed skew; use NTP monitoring
Schema drift breaks delta Destination field changed after bulk load 400 errors on delta API calls Poll metadata before delta; treat drift as blocking

Frequently Asked Questions

What is a delta migration?
A delta migration is a follow-up run that copies only records created or changed in the source system since the last successful load. It is not a full re-run or a retry queue — it re-queries the source for new or updated records and writes only the gap to the destination.
Why does re-running a data migration create duplicate records?
Most platform APIs default to create-only endpoints that always insert a new record. Without a persistent source-to-destination ID map and an upsert path, a second run cannot tell which records already exist and creates everything again.
How do I prevent duplicate records when re-running a Salesforce migration?
Use Salesforce's upsert-by-external-ID operation (PATCH to /sobjects/{Object}/{ExternalIdField}/{value}). Create a custom external ID field, populate it with the source system's ID, and upsert on every load. Salesforce updates existing records instead of creating duplicates.
Does Zendesk external_id prevent duplicate tickets?
No. Zendesk does not require ticket external IDs to be unique, and neither the Tickets API nor the Ticket Import API upserts on external_id. Before each ticket write, look the source ID up in your ID map or list tickets by external_id, and update instead of import when a match exists. Users and organizations are different, because their create_or_update endpoints match on external_id.
How long does the final delta sync take before go-live?
When the ID map and field mapping are already in place from the bulk load, the final delta typically processes only records changed since the last run and takes about 30 minutes. The exact duration depends on data volume and API rate limits.

More from our Blog