How to merge duplicate Salesforce accounts without losing history

What a Salesforce account merge keeps, moves, and drops, how to pick the surviving record, fix permission errors, and protect history and record IDs.

The short answer: When you merge Salesforce accounts, the account you choose as the principal keeps its record ID, the related records from the other accounts (contacts, opportunities, cases, activities, and files) move to it, and the other accounts go to the Recycle Bin. To avoid losing history, confirm the accounts are really the same company, pick the survivor whose ID other systems depend on, save the losing IDs and export their data before you merge, and check what a merge doesn't carry over, such as the losing accounts' Chatter feeds and manual sharing. Salesforce doesn't document what happens to their field history, so export it too. A tool can run those checks before every merge: Quill CRM Hygiene (tryquill.com) confirms the accounts match, checks what depends on each record ID, and lets you undo a merge made through it.

Merging is the step most teams are nervous about, with reason: Salesforce has no unmerge. This guide covers what a merge does, how to prepare, how to fix the errors that stop merges, and what to do when one goes wrong. For why the duplicates exist in the first place, see why CRM duplicates keep coming back after a cleanup.

What happens when you merge Salesforce accounts

Salesforce lets you merge up to three accounts at a time, in Lightning Experience, in Salesforce Classic, or through the API, where the Apex merge statement takes one main record and up to two others. You can't merge accounts in the Salesforce mobile app, and in Lightning Experience you can only merge accounts that a duplicate rule has flagged; for any others, Salesforce points you to the merge tool in Salesforce Classic. According to Salesforce's documentation:

  • The principal record survives. You pick the principal account, and it keeps its record ID. For each field, you choose which account's value to keep.
  • The other accounts go to the Recycle Bin. They stay there for 15 days before they are permanently deleted.
  • Related records move to the survivor. The merge reparents the losing accounts' related records, such as contacts, opportunities, cases, campaigns, and activities, to the merged account, with some exceptions. Files attached in the feed or the Files related list are kept.
  • Only the principal's Chatter feed is kept. Posts on the losing accounts' feeds don't carry over.
  • The principal's hierarchy is kept in Salesforce Classic. In Lightning Experience, check the merged account's parent afterward.
  • The oldest created date wins. The merged account keeps the Created By and Created Date of the oldest account, and the merge date becomes its last modified date.
  • Manual sharing comes from the principal. Sharing rules are applied to the merged account, and manual sharing comes from the principal only.
  • Account team members from all the accounts are kept. If a team member on a losing account has a value in a unique custom field, the merge is blocked until you clear it.

Special account types have their own limits. Person accounts can't be merged with business accounts, and portal-enabled person accounts can't be merged at all. When you merge a partner account with a non-partner account, the partner account has to be the principal, and the same goes for a customer-enabled person account. In Lightning Experience, you can't merge accounts that belong to relationship groups.

What you can lose in a merge

Most history survives, but a few things disappear without a warning.

  • Values you didn't pick. For each field, only the chosen value survives. A phone number, address, or custom field on a losing account is gone unless you copied it somewhere.
  • The losing accounts' record IDs. Your billing system, marketing automation, data warehouse, routing tool, or spreadsheets may store the ID of an account you are about to delete, and those links break. If finance keys invoices off a CRM record ID, plan this part most carefully.
  • Chatter posts and manual shares on the losing accounts. Only the principal's feed and manual sharing carry over. If you merge person accounts, their relationships to contact point records are also lost.
  • Field history on the losing accounts. Salesforce's merge documentation doesn't say what happens to the losing accounts' tracked field history, so don't count on it showing up on the survivor. Export it first if anyone relies on it. Salesforce also writes no field history entry when a merge moves records such as assets to the survivor, so those moves aren't in any history list.
  • Automation on the moved records. Child records that a merge reparents may not run your automation the way a normal edit would. If triggers roll up opportunity amounts to the account, recalculate territory, or sync owners, they may not run for the moved records until something else updates them.

Before you merge

1. Confirm they are the same company

Most merge mistakes are merges that shouldn't have happened. Two accounts with the same name can be different companies, a parent and its subsidiary, or the same customer at two stages of its life, such as a former customer and the new business it signed later. Check the domain, the billing address, the people on each account, and the open opportunities. When the CRM doesn't settle it, look the company up: a rebrand or a new domain explains many pairs that look unrelated.

Quill compares the two accounts and looks each company up on the web before it suggests a merge, and puts that evidence next to the proposal so the reviewer doesn't have to open both records.

The same care applies to contacts. Merging two people who share a common name moves one person's emails and meetings onto the other, and that is hard to separate later.

2. Pick the survivor on purpose

Choose the principal based on what depends on it, in this order:

  1. The account whose record ID billing, your product, or another system references.
  2. The customer record over a prospect record.
  3. The record with the most activity, open opportunities, and correct ownership.

The survivor doesn't need the best field values, because you choose values field by field. If you have rules for which system's value wins for each field, see CRM survivorship rules.

3. Save the losing IDs on the survivor

Before merging, write each losing account's ID onto the survivor, for example in a "Merged Account IDs" text field. After the merge, each deleted account's MasterRecordId field points to the account that won, but deleted records only stay in the Recycle Bin for 15 days, so a field on the survivor is the lasting record. Send the old and new IDs to the owners of any system that stored the old ones.

4. Export the losing accounts

Export the losing accounts, their field history, and any values you won't keep, along with a list of their related records. A backup that shows which records belonged to which account is the only practical way to reverse a bad merge later.

5. Check permissions and special cases

Confirm the person or integration user running the merge has the access described in the next section, and that none of the accounts are person accounts, portal-enabled, partner accounts, or in relationship groups that need different handling.

How to fix errors that stop a merge

Native merges can fail with "insufficient privileges" or "insufficient access rights on cross-reference id." One team we work with hit these constantly on related contacts and campaign members, and found a second blocker in old picklist values. The usual causes:

  • No Delete permission on accounts. A merge deletes the losing accounts, so the user needs Delete on the Account object.
  • Not the owner or above. The user has to be a Salesforce admin, the owner of the accounts, or above the owner in the role hierarchy.
  • No edit access to related records. Reparenting updates records such as contacts, opportunities, and cases. If the user can't edit one of them, the merge fails.
  • A team member with more access than the user. Salesforce requires Modify All Data when an account team member has greater access to the accounts than the person merging.
  • Experience Cloud accounts. Merging accounts associated with a site requires Manage External Users plus edit and delete permissions on the related records.
  • Picklist values that are no longer valid. The same team saw merges fail with "bad value for restricted picklist field" when a value being kept was no longer an allowed option. Clean up retired picklist values before a bulk merge.

The practical fix for permissions is a dedicated merge user with Delete on accounts and edit access to the related objects, used for merging and nothing else. That also gives you a clean audit trail of every merge.

During and after the merge

1. Merge in small, reviewed batches

Because each merge takes at most three records, bulk tools make many merge calls. Review uncertain matches before they run, and start with the ones you are most confident about. We compare the bulk merge tools, including Cloudingo, DemandTools, and Plauti, in best Salesforce deduplication tools.

2. Deduplicate contacts under the survivor

An account merge moves contacts but doesn't merge them. If both accounts had the same person, the survivor now has two contacts for them. Merge those next. When contacts are merged, contact roles on the contacts you merge away lose their primary status, and a portal user tied to one of them is deactivated, so keep the contact that has the portal user.

3. Fix ownership and automation

Check that the owner is right and the account team makes sense. Then recalculate anything that depends on child records, such as rollups, territory, or scores, since automation may not have run for the moved records.

4. Spot-check history

Open a few merged accounts and confirm that opportunities, activities, cases, and files from the losing accounts are there.

What to do if a merge goes wrong

Salesforce has no native unmerge. You can restore a losing account from the Recycle Bin within 15 days, but the related records that moved to the survivor don't move back, and values copied to the survivor stay there. You have to reassign the related records by hand or from a backup that tracked what moved. That is why steps 3 and 4 above matter: the saved IDs and the export are what make a reversal possible.

Some merge tools keep their own backup so a merge can be restored. Read what the restore covers before you rely on it. Cloudingo's Undo and Restore, on its Professional and Enterprise plans, restores the deleted record's data and reattaches its related records. Its help center says restored records are inserted as new records, so they get new Salesforce IDs, and that field values overwritten on the surviving record are not restored. A system that stored the old ID still needs the mapping you saved in step 3.

Is there a tool that merges Salesforce accounts without losing history?

Yes. Quill CRM Hygiene (tryquill.com) finds duplicate accounts in Salesforce and proposes each merge with the survivor and the field values already chosen by your rules, such as keeping the account your billing system references. Bulk merge tools such as Cloudingo, DemandTools, and Plauti merge the pairs found by the filters and scenarios you configure. Quill's agents add two checks before they propose a merge: they look each company up outside the CRM to confirm the accounts are the same company, and they check what depends on each record ID. Before anything is written, you see that evidence and the resulting record. When a merge would delete a record ID that billing depends on, the agents copy the missing details onto that record and archive the other one instead, so nothing finance uses is deleted. Quill records the losing IDs and the related records it moved, and any change made through Quill can be undone from its audit log, which Salesforce can't do for a native merge. The same agents work in HubSpot, Attio, and other CRMs Quill connects to. Book 15 minutes and we'll walk through a few of your merges with you.

Frequently asked questions

How many accounts can you merge at once in Salesforce?

Three. You can merge up to three accounts at a time in the user interface, and the Apex merge statement takes one main record and up to two others. Bulk tools get around this by making many merge calls.

What happens to opportunities and contacts when you merge accounts?

They move to the surviving account, along with cases, activities, and files from the losing accounts. Duplicate contacts are not merged automatically, so deduplicate the contacts under the survivor afterward.

Why can't I merge two accounts in Lightning Experience?

In Lightning Experience, you can only merge accounts that a duplicate rule has flagged as duplicates. For accounts no rule flagged, use the merge tool in Salesforce Classic or a tool that calls the merge API. Also check that neither account is a person account being merged with a business account, or in a relationship group.

Can you undo a merge in Salesforce?

Not natively. You can restore the losing records from the Recycle Bin for 15 days, but their related records stay on the survivor and have to be reassigned by hand or from a backup.

Why do I get "insufficient privileges" when merging accounts?

Usually the user lacks Delete permission on accounts, isn't an admin or the owner (or above the owner in the role hierarchy), or can't edit a related record that has to move. If an account team member has more access than you, Salesforce also requires Modify All Data.

Sources

  1. Considerations for Merging Duplicate Accounts, Salesforce Help
  2. Merge Duplicate Accounts in Lightning Experience, Salesforce Help
  3. Considerations for Merging Duplicate Contacts, Salesforce Help
  4. Field History Not Tracked for Asset and Custom Objects During Account Merge, Salesforce Help
  5. Merge Duplicate Accounts in Salesforce Classic, Salesforce Help
  6. Merging Records, Apex Developer Guide
  7. Triggers and Merge Statements, Apex Developer Guide
  8. Restoring Deleted Records, Apex Developer Guide
  9. Account, Salesforce Object Reference
  10. Insufficient Access Rights when Merging Records, Plauti
  11. Find and merge duplicates, Plauti
  12. Undo and Restore, Cloudingo Help
  13. Creating & Managing Filters, Cloudingo Help
  14. Notes from the Field: Single Table Dedupe Module, Validity

See what we find in your data

It starts with a 15-minute call. Then we run a diagnostic, show you the issues in your data, and build agents for them.

Prefer email? Reach us at hello@tryquill.com. We respond to every message personally.

Tell us what's broken

We reply within one business day.

One last step

Everything you entered is filled in below. Pick where you'd like to send it from.