Skip to content

Merge Duplicate Accounts

Menu Location: Customers > Merge Duplicate Accounts

Last Updated: 2026-11-17


Overview

This page combines two customer accounts that belong to the same person into one. It is for the case where a customer signed up twice, for example after a typo in their email or an abbreviated street address got past the normal duplicate checks.

You pick the primary account (the one to keep) and the duplicate account (the one to absorb). The page shows you a side-by-side preview of exactly what will move before anything is changed, and only merges after you tick the confirmation box.

A merge is not a delete. The duplicate account is set to Dead, not removed, and a full record of what moved is written to a note on both accounts, so a merge can be reviewed and recovered if needed.


Primary Functions

  • Pick a primary (keeper) account and a duplicate (absorbed) account by customer number
  • Preview both accounts side by side before anything changes
  • See how many rows will move from each table on the duplicate
  • See how the two subscriptions will be resolved
  • Confirm and run the merge, with a before-snapshot kept in a log file

Getting Here

Three ways in:

  • Customers menu > Merge Duplicate Accounts (start from scratch and type both account numbers).
  • Customer Info page > the small Merge a duplicate account link under the account's Created / Last login lines. This opens the page with the customer you are viewing already filled in as the primary (keeper), which is the usual path once you know the other account number.
  • Customer Info page > Possible Other Accounts > the merge link on a matching row. This opens the page with both account numbers filled in and the preview already built, so you can review it straight away.

Merging Two Accounts

Steps:

  1. Open the page, or open the customer you want to keep and click Merge a duplicate account (or click merge on a row under Possible Other Accounts).
  2. Enter the Primary (keeper) account # (the account that survives).
  3. Enter the Duplicate account # (absorbed) (the account that will be emptied and set Dead).
  4. Click Preview merge. (If you arrived from a merge link on a matching row, the preview is already built.)
  5. Review the preview:
    • The comparison table shows Account, Login email, Status, Created, Orders, Subscription, and Balance for both accounts.
    • What will move lists each table on the duplicate that has rows, with the row count, for example how many orders, payments, and notes will transfer.
    • Subscription explains whether the primary's subscription is kept and the duplicate's ended, whether the duplicate's only subscription is moved onto the primary, or that there is no conflict.
    • Login confirms the duplicate's login email will be disabled and kept as a secondary email on the primary.
    • Balance shows the duplicate's balance that will be added to the primary's.
    • Any warnings, such as both accounts having a subscription, appear in a yellow box. Read these before continuing.
  6. Tick the checkbox: "I understand account #... will be emptied into #... and set to Dead."
  7. Click Merge accounts and confirm the dialog.

On success you are taken to the primary account's Customer Info page with a message linking back to it, and the full record of what moved is in the notes on both accounts.

If the confirmation box is not ticked, the page tells you to check it and nothing changes. If the merge fails partway, the page reports the error and returns you to the preview; the merge is rolled back where the database supports it and the log records the failure.


What a Merge Does

  • Child records move. Orders, payments, notes, likes, feedback, favorites and any other customer-linked records on the duplicate are re-pointed to the primary. The tables are discovered from the live database rather than a fixed list, so tables added later are still included.
  • Subscription. If both accounts have a subscription, the primary's is kept and the duplicate's is marked Dead. If only the duplicate has one, it is moved onto the primary. This keeps the delivery schedule of the account you chose as keeper.
  • Login email. The duplicate's login is disabled by renaming its username to a reversible placeholder, and its email is kept as a secondary email on the primary so the account stays findable by that address.
  • Balance. The duplicate's balance is added to the primary's, and the duplicate's balance is set to zero.
  • Duplicate account status. The duplicate is set to Dead. It is never hard-deleted.
  • Audit trail. A summary note is added to both accounts, and a before/after snapshot is written to kiv/csv-uploads/merge-accounts-log.txt for recovery.

Troubleshooting

The account numbers are rejected. Both must be real customer numbers and must be different. The page tells you which one it could not find.

Both accounts have a subscription. The preview warns you. Make sure the primary really is the account whose delivery schedule should survive, because the duplicate's subscription is ended.

The keeper account is already Dead. The preview warns you that you may have picked the wrong keeper. Double-check the numbers before merging.

I merged the wrong pair. The duplicate is set Dead rather than deleted and both accounts carry a note naming what moved. Use those notes plus the snapshot in kiv/csv-uploads/merge-accounts-log.txt to work out what happened and put it back by hand.


Recent Updates

2026-11-17

  • Page and merge tool added: pick a primary and duplicate account, preview what moves, confirm, and the duplicate is absorbed and marked Dead.
  • The entry point on the Customer Info page is now a small Merge a duplicate account link rather than a full-width banner, and a merge link was added to each row under Possible Other Accounts that opens the preview with both accounts already filled in.