Zotero/Zotfile duplicates attachments?

I recently started using Zotero (+Zotfile), so please forgive my ignorance. Also, while writing this question I realised I am having a hard time describing the problem clearly, so please bear with me and ask for clarifications if anything is unclear.

I have a (small) collection with PDFs that I manually linked to Zotero. Initially everything looked fine, having 1 attachment for each parent item, but for some reasons the attachments are duplicating. See https://imgur.com/M9q8X1a for example: the publication by Rouet-Leduc et al is listed twice, and is now physically present in a subfolder as "[title].pdf" and "[title]2.pdf" ([title] refers to a long title of authors/year/publication title/etc). The publication by Valentine et al. (2013) is listed five times, two of which are physically present in a subfolder "[title].pdf" / "[title]2.pdf", and the other three are no longer found on the hard drive. There are other publications that don't have duplicates in the file subfolder (so no [title].pdf / [title]2.pdf), but still appear as duplicates attachments that can no longer be found. And there is one publication that has not been duplicated at all.

I haven't detected much systematics in this behaviour, and I cannot imagine that this is intended by the developers. I wonder if this behaviour will persist, creating more and more duplicates (and duplicates of duplicates, etc.), and I would like to know if there is a way of automatically cleaning up these duplicates. For my little test collection it wouldn't be a problem to do this manually, but for my main collection (comprising thousands of publications) it is practically impossible to do so.

In the end, I want to have the attachments of each Zotero collection in their own subfolder on my file system, and not buried in this terribly cluttered and obscure Zotero storage folder.

Again, apologies for the confusing problem descriptions.
  • With Zotero alone, the only way this would happen would be if you 1) had duplicate top-level items and 2) merged them using Zotero's merge functionality. Attachments aren't currently deduplicated when you merge items and just get placed under the merged item.

    If you haven't merged duplicate items, it's possible ZotFile is doing something to cause the duplicates, but I wouldn't be able to help with that.
  • I would add, though, that you generally don't use "Link to file…" if you're using ZotFile (and since most people who use linked files use ZotFile, most people just don't use "Link to file…"). It's possible that if you link files manually and then also use ZotFile to rename/move them, you can end up with a duplicate copy in the configured folder.

    Basically, ZotFile takes care of the linking for you, so the standard usage would just be to drag a file to Zotero if it's an existing file on your disk or save the article page (with an automatically attached PDF) from your browser with the Zotero Connector.
  • I suspect indeed ZotFile is playing some foul tricks; I need to do some more testing to verify. Certainly these duplicates were not caused by the merge functionality. Would there be a way to automatically detect/remove duplicate attachments?

    I was trying to adopt the approach you suggested me earlier of importing items from the web, but after my first attempt I got bogged down with this issue of duplicates. I feel I still have a long and painful way to go in restructuring my workflow.
  • edited October 23, 2022
    Hi, just chiming in here. Same issue, except that I started accumulating references back when Zotero was a Firefox plug-in, and kept on upgrading ever since. ZotFile is a recent addition in my workflow, and only even more recently did it started duplicating already existing attachments. Except manually removing them as I find them, I wish there was an automated way to find duplicate *attachments* as there's a built-in function to find duplicate *items*.
Sign In or Register to comment.