Deleting Local Files

My Laptop is nearly full. I would like to delete local files from Group Libraries that I own whilst keeping them online. I switched off sync for these Libraries but of course that didn't delete the local copies.
1) Is it safe for me to now delete the local copies using my local Zotero client?
2) If I ever want to re-sync, will having deleted the files locally result in the delete being "synced" to the web library and the files then being deleted in the web library? If so, how to avoid this in the future?
  • tnajdek Zotero Team
    To answer your questions directly:
    1. Is it safe to delete local files from within the Zotero client? No -- deleting files from inside Zotero will sync the deletion to the web library and remove the files online too. You need to delete them via your operating system instead (see below).
    2. Will re-syncing in the future cause the deletions to propagate online? No -- if you delete files via the OS (not inside Zotero), re-enabling sync is completely safe. Zotero will not interpret missing local files as deletions and will simply re-download them from the server as needed.
    Here is the safe procedure:
    1. In Zotero Preferences → Sync, set file downloads to "As Needed" for your group libraries.
    2. Make sure all files are fully uploaded and synced to Zotero servers before proceeding.
    3. Navigate to the storage folder in your Zotero data directory: https://www.zotero.org/support/zotero_data
    4. Inside storage you will find many subfolders with random letter/number names. Each contains an attachment file plus some Zotero internal files. Delete only the attachment files (PDFs, docs, etc.) -- do not delete the subfolders themselves or the hidden .zotero-* files inside them, as Zotero needs these.
    5. Do all of this from your OS file manager (Finder on Mac, Explorer on Windows) -- never from within Zotero.
  • edited 11 days ago
    Note, though, that that procedure doesn't distinguish between different groups as well as between different groups and my library.
    There is no easy way, currently, to locally delete the files just from a specific group/library. It could be scripted (you can get all the folder names for a group with some javascript in Zotero and then use any type of script to remove the local files), but obviously you'll want to know what you're doing if you're using scripts to delete files from your harddisk (though you can always, of course, have a good back-up of the whole folder).

    I think Zotero devs have mentioned a feature that will allow you to set a preference to delete local files after X days as planned, but I have no idea about the status of that and I certainly wouldn't plan on that happening in the short term.
  • Thank you both.
Sign In or Register to comment.