Deleting linked locally-stored PDFs from Zotero

Hi,
please bear with me - I've only been using Zotero for a couple of weeks.
I have a large library of PDFs, built up over many years, and have started adding those references to Zotero.
However, initially I mistook "Attach stored copy of file" for "Attach link to file" and have accidentally generated a huge Zotero storage file on my PC with, presumably, duplicates of all my PDFs.

If I delete the individual folders in the Zotero storage folder (called things like "8QY5EDF2"), I then cannot add a link to the file in its original location (instead of the Zotero storage folder). Everything I tried produces the well-known error "The attached file could not be found at the following path. It may have been moved or deleted outside of Zotero, or, if the file was added on another computer, it may not yet have been synced to or from zotero.org".

If I try to attach a link to the original PDF of a reference (which is still where it always was on my local computer), it appears to work, but clicking "Show file" from the context menu then re-produces the above error. I was expecting it to show me the folder on my PC containing the PDF.

What I really want to do is undo all the existing file linking and start again with an "Attach link to file" right-click on each reference.

To make the problem more interesting, I am using a "constrained" version of Zotero over my company network, which doesn't allow sync to zotero.org. So the local hard drive is all that I have available to store references - definitely don't want each one stored twice!

I am running Windows 10, and Zotero 6.0.30 (distributed as part of "managed software" via my company IT department).

Any suggestions gratefully received.
  • edited January 30, 2024
    You should never directly delete folders under Zotero\storage. There are entries in the Zotero database that refer to to those folders. Zotero can manage the sort of problems you have by itself. Hopefully there won't be any fallout from your strategy. ;)

    Your issue now should be just with the PDF attachment entries that no longer have the correct location to find the PDF file. You can just move those broken PDF attachments to the bin (that's also what you should have done to remove the duplicate PDFs in Zotero storage that you didn't want to keep) - right-click *on the PDF attachment* and select Move Item to Bin, or just drag the broken PDF attachment to the Bin in the left pane.

    Presumably you still have the PDFs you want to link to Zotero in their original folder location outside Zotero. You can now just add new PDF attachments that link to where those PDFs actually are. To add a link to a PDF, you can click on a parent item (if it already exists) and then right-click Add Attachment\Attach Link to File. Or you can just drag a PDF from its folder in Explorer onto that parent item while holding down the Ctrl key (dragging without the Ctrl key would make a copy of the PDF in local Zotero storage). See "Adding linked files" under Drag and Drop ...
    https://www.zotero.org/support/adding_items_to_zotero#adding_pdfs_and_other_files

    If the parent item does not already exist to drag the PDF onto, Zotero will attempt to create one from what it can read from the Ctrl-dragged PDF. If there is not enough available information for it to do that, the PDF link is deposited without a parent item, which you then create for it. See "Standalone Attachments and Parent Items" at the above link. As a last resort, you can also manually create a parent item from scratch (and then drag the PDF link onto it) - see Manually Adding Items at the above link.

    'Show File' takes you to the folder location of what you right-click on. If you click on a parent item, it should take you to the folder under Zotero\storage for that item, the only place where parent items can be stored. If it's not doing that, that could reflect a more serious error for that item parent. If instead you right-click on a linked PDF created as above, Show File will take you that linked PDF's folder.

    There are pros and cons for linked PDF strategies, in particular for people like you who have large existing PDF collections that they are used to accessing outside of Zotero. Some choose to maintain those externally-located collections (as linked PDFs); others are happy to move them under local Zotero\storage (Zotero devs' recommended strategy for all users). There are some limitations on the use of linked files. If your company eventually allows you to sync to Zotero online, that would not include linked files. Syncing the linked file folder across computers (linked files don't work with the Zotero mobile app, nor with Groups) is the user's responsibility (eg via a cloud-mirrored folder service like Dropbox or Google Drive). On the plus side, linked PDFs do not count towards your Zotero file storage quota.
    https://www.zotero.org/support/attaching_files#stored_files_and_linked_files

    People who do use linked PDF files generally use Zotfile to help manage them under Zotero v6 (to be replaced by similar plugins for Zotero v7, currently in beta).
    https://forums.zotero.org/discussion/104858/on-zotfile-development-and-zotero-7#latest


  • Thanks @tim820. That has sorted it.

    I was following the advice of adamsmith in https://forums.zotero.org/discussion/54293/removing-files-from-standalone-but-not-online which seemed to imply that I needed to remove files using the operating system and not Zotero.

    I also hadn't realised that, by clicking the down-arrow next to an entry in my library, it would show the various links (broken and OK) that are associated with the entry, and which could then be selectively deleted. Initially it was just sending the whole entry - with metadata, tags and attachment - to the trash, which is definitely not what I wanted to do.

    Nice hint on the Zotfile plugin. I'll check it out, although my experience of running any application in a "managed environment" (such as my company network) is that installing plugins is verboten :-)

    Thanks again.
Sign In or Register to comment.