Consolidate PDF files from various subfolders?

Zotero has stored my PDF files in a wide variety of subfolders, and I would like to consolidate them. Some are stored directly in the "Zotero" library folder (I'm using a Mac, so it's /Users/[username]/Zotero). (Many) Other files are saved in Zotero>storage>[random numbers and letters], for example in subfolders called "2RZ8L9YV" or "SD2ZP5A5". I want to move all the PDFs out of the subfolders and into the main "Zotero" folder without breaking the link within Zotero (i.e. so I don't have to relocate each files the first time I want to use it again in Zotero). The directory settings for Zotero and Zotfile are for the main folder (/Users/[username]/Zotero), not any subfolders.

If there is no way to automate this consolidation while retaining the links to the files in Zotero, can anyone at least explain to me why some files but not others are placed in these randomly-named subfolders?

Apologies if this concern has already been addressed elsewhere. I searched and couldn't find an answer to this specific question.

Thanks.
  • edited January 25, 2018
    https://www.zotero.org/support/attaching_files#file_copies_and_links

    Zotero stores all files within 'storage'. If you have files in the root of the Zotero data directory (which you shouldn't), those are linked files that either you put there or you told ZotFile to put there.

    Only stored files should go within the data directory, and generally speaking you shouldn't touch the data directory yourself. If you want to use linked files, you should store those elsewhere on your hard drive, outside of the Zotero directory. You can use the Linked Attachment Base Directory setting to collect those files as relative paths, move them elsewhere, and adjust the base directory setting accordingly. (You can also use the Zutilo plugin to just adjust the absolute paths manually.)
  • Thanks for that info. It seems Zotfile was moving stored files to the root of the Zotero data directory. I have now rectified that in settings. (And I'm using all stored files, not linked, so the linked attachment base directory doesn't matter in my case.)

    Now the question is: is there any automated way to move the files from the base directory to their proper places in 'storage'? (I have about 500 files there, so I don't want to have to do them manually!)

    Thanks.
  • If they're in the root and you can still open them, they're linked, not stored, even if that's not what you intended for ZotFile to do. Zotero is only capable of opening stored attachments within 'storage'. (The icon will also show a little chain when they're links.)

    I don't know if ZotFile has the ability to convert linked files to stored files — that's not possible in Zotero itself (nor is the opposite). If you do have to do them by hand, one way would be to click on a linked attachment in Zotero, right-click, Show File, and then drag the file back to the same item in Zotero to convert it into a stored attachment, and then delete the linked attachment. Alternatively, you could just select all the files and drag them into Zotero as top-level items, and then reorganize them under their parent items.
  • Zotfile can convert linked attachments to stored by switching to “Store files using Zotero” in the Zotfile settings.
  • Thank you both for that further information. I could not find a "store files using Zotero" setting, though I did see "attach stored copy of file(s)", but that seems to only work for future attachments, not moving old ones.

    For anyone else with this problem in the future, I did find a solution here:
    https://forums.zotero.org/discussion/34477/moving-storage-folder-by-zotfile

    "K. Vijayanth Reddy May 5, 2015 edited May 5, 2015
    @allenleeshining: Actually, the second method that you outline, you do not need to transfer files back to Zotero first. Just change the custom folder location and select all your attachments and hit "Manage Attachments>Rename Attachments". They will be transferred to the new location leaving behind just the empty directory tree (no files) at your previous location."

    I moved the directory, then sorted resources in Zotero by attachment to see which had broken links (indicated by empty blue circle outline in the attachment column). I added those to a temporary folder, moved the directory back to the place I want it, ensured the Zotfile settings were correct, then selected all and renamed attachments. Worked like a charm. Thanks again for the help.
Sign In or Register to comment.