Skip to content

Dedupe and merge

The same paper got imported three times — once from the browser connector, once from a BibTeX file, once by DOI — with slightly different titles each time. Zotero’s built-in duplicate detection is conservative and its merge is manual, one group at a time. You want to find near-duplicates across the whole library and clear them out.

“Find duplicate titles in collection Reading list, including fuzzy matches, show me the groups, then merge each group keeping the oldest as the master. Back up first.”

The agent takes a backup, finds duplicate groups (exact or fuzzy), shows them for your approval, and merges — oldest item as master.

Terminal window
zot dedupe --by title --collection SS5MVVB6 # exact-title duplicates
zot dedupe --by title --fuzzy --collection SS5MVVB6 # near-duplicates (Levenshtein)
zot dedupe --by doi # duplicates by DOI

Review the groups, then merge (oldest item becomes the master):

Terminal window
zot backup # REQUIRED — merges cannot be undone
zot dedupe --by title --merge --yes

Scope with --collection before ever running library-wide.

Terminal window
zot backup # snapshot zotero.sqlite
zot dedupe --by title --fuzzy --dry-run # inspect groups before committing
# ... verify the groups are true duplicates ...
zot dedupe --by title --merge --yes

If a merge went wrong, restore the zotero.sqlite snapshot that zot backup printed the path to.