cannot relink local PDF files (and sync them to my online account)
Thanks for a wonderful product, Zotero is really great. I tried to find a solution to this by reading other posts but drew a blank so I thought I would ask directly.
I recently accidentally broke my zotero in a way that for a complete library all of the locally saved pdf files have become detached and do not appear and cannot be opened from Zotero. My online account (with unlimited storage) has synced this change so they are not available there either. All the files are present locally in my "storage" directory, unchanged from before and in the same default location (user/zotero/storage), so I think it is some setting in the sqlite database but for the life of me I can't figure out how to fix this. I have a backup sqlite file from 9 months ago that I can copy-paste and the pdfs (up to that point in time) reappear, but when the new sqlite file syncs, the linkages are all lost again. I would love help with this if anyone has a solution! Thanks so much.
I recently accidentally broke my zotero in a way that for a complete library all of the locally saved pdf files have become detached and do not appear and cannot be opened from Zotero. My online account (with unlimited storage) has synced this change so they are not available there either. All the files are present locally in my "storage" directory, unchanged from before and in the same default location (user/zotero/storage), so I think it is some setting in the sqlite database but for the life of me I can't figure out how to fix this. I have a backup sqlite file from 9 months ago that I can copy-paste and the pdfs (up to that point in time) reappear, but when the new sqlite file syncs, the linkages are all lost again. I would love help with this if anyone has a solution! Thanks so much.
This discussion has been closed.
What's an example? What's the path where it's looking, and what's the actual path of the file? Can you provide a Debug ID for trying to open a file that doesn't work?
OK, when trying to get the info you asked for I discovered that my new sqlite db is looking in a folder that doesn't contain a pdf (folder name is SHJKR63T), but if I copy-paste back the old backup from 9 months ago, it looks for the same paper but in a different folder (8YVMW9GW) that does contain the pdf. So it looks as if the sqlite db got somehow rebuilt at some point with all new folders.
I am not sure what I did to accomplish this. This is a shared library, so I guess that it is also possible that one of the other people sharing it did something to trigger this, and it synced remotely then my local synced this way. But I am not sure the action that did it I am afraid.
There's some significant confusion here, though:
1) Neither of these items has been touched in years.
2) Both have files available online.
3) 8YVMW9GW is an HTML snapshot, while SHJKR63T is a PDF. Are you sure these are the folder names you meant?
Again, I'd have to see a Debug ID for opening a file that doesn't exist to say more.
I just picked this item as an example but all the items in this library are affected.
The files I listed were both accessed in the zotero desktop client from the same collection in the same library, but one was from a zotero.sqlite database that is current, and the other was from a zotero.sqlite database backup from March of last year (unfortunately I don't have any other valid backup between these dates). Clearly these two sqlite databases point to different files on disk for (nominally) the same item. When I say "the same library and collection" I mean that I open zotero and navigate to the same library and collection name and click on the same item (but opening zotero with the different database sqlite files.)
This is why I feel that a new sqlite file was "rebuilt" somehow and at some point by some means so all the items point to new folders in source. It's like the the structure of the library didn't change on the front end (all the collections are there and all the items are in the collections) but on the back-end they point to different folders in source.
I am not sure I can generate a Debug ID because there is no error...when I open with zotero with the new sqlite db there is no pdf to open so I can't try and open it to generate an error, and when I open zotero with the backup, the pdf file is there and there is no problem opening it.
Sorry it is a bit complicated, and thanks for the help, but any help is appreciated.
1) I check the current zotero.sqlite file is in the zotero folder
2) I start the zotero windows client
3) I click on collection eb_pyroxene in the group library
4) I enable debug logging
5) I double-click on the "orbital molecules in ..." Attfield paper
6) Zotero opens a saved html file in this case (file:///C:/Users/simon/Zotero/storage/EIHHJXHC/1.html)
7) I submit the debug and get a Debug ID of D736185269
8) Now I close the zotero client
9) I delete the zotero.sqlite file
10) I copy the file zotero.sqlite.111.bak (which is a backup from March of 2022) and rename the copy as zotero.sqlite
11) I reopen the zotero client
12) I click on collection eb_pyroxene in the group library
13) I double-click on the the "orbital molecules in ..." Attfield paper
14) This time it opens an attached pdf file that wasn't there before. If I right click and select "show file" I find it is in a folder with the name ZC6R7N4V in zotero storage.
15) I submit the debug and get a Debug ID of D562764459
I think that zotero is working fine, but somehow at some point between March and now (it actually happened recently) the entire library has become reconnected to a new set of folders with no PDFs in them. The old folders are presumably there (should probably double check that) but they are no longer linked to the items in the collections.
So two questions I have are (a) what could have happened to cause that (I don't want it to happen again)? and (b) is it possible to find all the _old_ folders and reconnect them without doing it one by one?
Thanks again.
On December 14 and 15, the one other admin in the group moved 5,900 attachments to the trash. If you look in the trash, you'll see them there. Since the PDF is in the trash, when you double-click the parent item, it opens the remaining attachment, which is an HTML snapshot. That's it. You can restore the items from the trash.
Thanks so much for the help, that was driving me crazy. The other admin is my student who is about to defend his thesis so I just found out he was doing some cleaning....
Once again, thanks for a really great product!