Lost a bunch of PDFs. Safe to combine old & new Zotero Storage folders to reattach?

Hi, a bunch (maybe half) of my PDFs are no longer attached in Zotero, and although I know where at least some versions of them are, I don't know the best way to get them all back in the same place. My first instinct is to copy all of the subfolders in the old Zotero>Storage folder (which is apparently not the one linked to Zotero at the moment) and paste them into the current Storage folder. I assume/hope that this would pull everything (including any notes, metadata, etc.) while still keeping any items I've subsequently added. However, not being an expert in file syncing/Zotero, I'm unsure if this is a dangerous move (and/or how it might be affected by sync).

As background, I purchased a storage plan last May specifically so that I could more easily transfer my library when needed, which ended up being important because I had a hard drive failure within months of transferring everything to a new computer. I'd followed the instructions for moving to a new computer; option A is simply to set up Zotero sync, and there were no warnings that this wouldn't allow for a complete transfer, so that's what I did. I have the 2G plan and am nowhere near capacity, so that's not the problem. It does appear that only some of my library is synced right now (~ the same MBs I'm seeing in the "current" Zotero storage folder), but I don't know which happened first - if syncing somehow removed half of my files along the way w/o me knowing, or if only half of my files were synced in the first place. The latter seems highly unlikely because I think I'd have checked that everything synced, and I *definitely* was not having issues accessing these specific files during the first few months after purchasing the storage plan (I was very actively working on my paper and accessing tons of refs at the time, through August). So, if what's showing up now as synced is all that's ever been synced, then there was a difference between what I had stored on my computer and what synced. (If you can see my sync history and confirm that a bunch of stuff disappeared somehow, I'd appreciate it, but I guess that's less of a concern right now than just getting the missing half of my files re-linked in Zotero.)

The old version of my Zotero storage (the full "Zotero" folder which I manually copied over from an external hard drive backup) - is over twice the size of the current storage folder, so it's definitely the comparatively more complete one. However, I don't want to fully replace my active Storage folder and SQLITE file with the old ones because the old version is missing things I've added in the last couple months, before I realized anything was missing. I don't think I added a ton, but still...(esp. because one of them I had to add every piece of metadata manually.) I also might have removed some duplicates at some point, although I can't really recall when exactly I did that cleanup, as it's been piecemeal (& is nowhere near done).

So is it safe for me to simply copy over the subfolders in Storage from the old to the new Storage folder, skip the prompt to "replace" any of the files, and just hope that everything, including all of the metadata and notes, if applicable, copies over successfully without overwriting new refs? I'm not sure if any of the references themselves or notes are actually missing, as opposed to just the PDFs (and it might be a while before I find out), but I suspect it's only the PDFs because the number of folders in the old Storage fodler is similar to (in fact, ~30 folders less than) the current Storage, despite being twice as many MB in size. Thanks in advance for the help.
  • Hi, a bunch (maybe half) of my PDFs are no longer attached in Zotero
    Could you say exactly how that manifests? Do you get an error when trying to open an attached file, or is there no attached file icon in Zotero at all (or something else entirely)?
  • @laurelp: Files never disappear once uploaded, so these just weren't uploaded. This would've happened because you were at your file storage at the time and never performed a file sync on the computer where the files were added after upgrading your storage. You might have stopped syncing that computer altogether, ignored the quota warning, or disabled file syncing in the preferences to make the warning go away.

    All files added since you upgraded your storage were uploaded, but that would've had to have been on a different computer that never had these files, since old files would've immediately uploaded along with any new files once you had the storage space.

    These are the 35 missing files:

    3J7ZMREM
    4R58DLFS
    7PQM3CZY
    7W8JLLFE
    97J2NH5G
    97Z5AWS4
    ACZFJ5LW
    C3LDJN2B
    C6GCGIGC
    EYCKBTU9
    FTSXDH99
    GD7VYASK
    GZ439W4J
    IXS7C6XA
    J67L8SZQ
    JHC9DTQ2
    KQZCGZI4
    KV6ZNJVC
    L4QGYP5W
    LAUNIRX9
    LYBI56MF
    NXFJF3N7
    PYBHPQVW
    QFBRF6ME
    QPK836EM
    RYCNPJBI
    T4TTSDEB
    TM4JEVI4
    TMDJZMBK
    UJ6VPIFA
    UWTIXP2D
    VHBNFL53
    WYZPPHBG
    YJKYJR3J
    YT25CWKM


    If you have these folders, I'd recommend just copying these instead of overwriting anything.
  • Hi again,

    I appreciate the response. I did try copying over those folders, although some of them didn't have the PDFs in them, and I'm still running into missing PDFs after having done that. I still don't understand how this happened because I definitely never turned off file syncing. But I've had a lot of computer problems and a couple of new OS installations/new hard drives over the last year, so it might just have to be chalked up to that. I just worry that I'm not reinstalling /copying over Zotero properly, which is why I upgraded my storage in the first place - to ensure it would go smoothly. :( And now even though I'm still dealing with missing files on my current installation, I'm about to have to go through it all AGAIN because my laptop started freaking out on me, and I'm told all I can do is a fresh Windows reinstall, which means losing all of my programs again. (I'm told my data is safe, but I'm guessing they're referring to things like my Desktop, not data within Program Files.) Any guidance on the smoothest way to do this? I followed instructions on the website on how to do it the last couple of times and clearly still managed to screw something up, so any explicit guidance/help would be greatly appreciated. Thank you.
  • All your Zotero data is stored in the Zotero data directory. If you back that up, you can restore your library to the identical state. See instructions on that page for details, but there's really nothing to it — that folder just needs to be returned to the same place.
  • I just wanted to update for others who might read this (&/or if devs are willing to still help) that I continued to have this issue and have ended up just manually re-adding pdfs as I go. But I'm still seeking a solution because this manual approach is tedious, & it's not easy to tell which refs are missing PDFs. Unfortunately, the above guidance did not fix my issue because most of the instances of the missing PDFs seemed to entail the reference still being in Zotero (and still having its unique folder), but the PDF is no longer in the folder, even though Zotero shows it as still attached unless I explicitly try to open the PDF. Only the cache file that includes the citation metadata is still there. I still think I'll need to identify & overwrite these mostly empty subfolders, but I've been unsure if there's a safe way to do this, given that I added a lot to my library after losing those PDFs (& before I realized the issue) & thus could not simply restore the library. I might test the copying/pasting of old onto new folders with the same name on a couple refs & report back.
  • Update - I believe that I mostly fixed the problem myself, my web file syncing is still not updating, which is still a concern. But I can at least access all of my PDFs in the Zotero desktop app again. I'll include details of that below in case it helps anyone else who might see this but would like help from the devs about the web attachment sync issue if they see this.

    To fix the missing PDFs issue in the desktop app/storage subfolders, I used a Python script to see how many files were affected (hundreds) and then adapted it to copy/paste the relevant files from my older backup Zotero storage folder to the matching subfolder in the active Zotero storage. With the script, I was able to tell it to ignore any subfolders that already had a PDF file (and also to not copy over a PDF if the md5 checksums matched ANY others overall in the active zotero storage folder). Not sure how well the latter part worked, but I seem to have my several hundred missing PDFs reattached in Zotero now. (Previously, they were all showing as still attached but could not be found once I tried to open them & were clearly missing from the folders when using "Locate."

    To clarify, I know that I synced all my files including attachments on my computer after purchasing the 2 GB storage plan, and I can even still see the original PDF attachments on the web version, but they are grayed out (similarly, I could see them in the desktop app but just couldn't open them). And I was successfully opening those PDF attachments before this mess happened, so they did somehow get unlinked despite my carefully following the instructions for syncing Zotero to a new computer.

    Again, my newly restored PDF attachments on my computer are still not syncing in Zotero web, so I'll need to figure out how to address that.
  • edited 4 days ago
    Just to note, if you're at the point where you're writing a Python script, it would've been far, far easier to just run a single rsync command to copy any files from the source folder that didn't exist in the target folder. There was no need to script this.
    and also to not copy over a PDF if the md5 checksums matched ANY others overall in the active zotero storage folder
    This part wasn't correct. If the files existed in other folders, those were different attachment items (e.g., in different libraries). I know you still think that the files were somehow unlinked and given new keys here, but I promise you that's not a thing that can happen. The files just weren't uploaded from the computer where they were added.
    To clarify, I know that I synced all my files including attachments on my computer after purchasing the 2 GB storage plan, and I can even still see the original PDF attachments on the web version, but they are grayed out
    No, this is a misunderstanding. You did not sync them — if you did, they would've still existed online, any other Zotero client would've been able to download them automatically when you tried to open them, and you never would've gotten the file-not-found error. Attachment items always show up online, but that has nothing to do with whether the files themselves are available.

    The only exception to this — the only way for synced files online to disappear — is if you manually ran "Purge Storage in My Library" from your storage settings page, but I assume that's not something you did.
    Again, my newly restored PDF attachments on my computer are still not syncing in Zotero web, so I'll need to figure out how to address that.
    See Files Not Syncing, and if you're still having trouble provide the requested info.
Sign In or Register to comment.