orphan attachments
Due to a backup error I copied deleted attachments/folders back to the 'storage' folder. Which means that the storage folder now holds attachments which should not exists. Since I do not know the names/dates of these attachments/folders, I cannot remove these orphan files/folders.
Is there a solution for this issue?
thank you
Is there a solution for this issue?
thank you
http://github.com/mronkko
[Edit: sorry, exactly what adamsmith and bwiernik had in mind…]
The python script gave me a readout:
XX attachments
YY files
XX missing attachments
YY unattached files
Where the same values were listed for both pairs of XX and YY. Probably shouldn't be that way. And I'm not sure how to make it 'do' something.
The perl script gives an error saying "unable to open database file" for the zotero.sqlite file even when firefox is closed.
Am I doing something wrong?
Any idea on how far away official support for this is? If its not too far off I'll just leave it, but otherwise I would like to try to remove all of my orphaned attachments.
My use case is simply that I've deleted Zotero entries but the linked attachments (in my Google Drive folder) remain.
1. Set Zotfile directory to a new temporary location e.g. \Documents\ZoteroTemp.
2. Highlight everything in your library > right click > manage attachments > rename attachments.
All attachments get moved to the temporary directory. Will take a while for large libraries.
Now simply delete the entire folder where everything was just moved from (\Documents\ZoteroOld). The orphans are gone.
3. Create a new directory for where you want your attachments to go, for example \Documents\ZoteroNew - Or it can be the same as what you just deleted.
4. Change the directory back to this new directory in Zotfile preferences.
5. Highlight all and and rename attachments as before.
Now everything is moved back. All files in that folder are now linked, and all the orphans are gone.
Really quite simple, ZotFile is such a handy tool.
Remember to back up your attachment directory beforehand just in case.
The underlying issue is that when I look for a pdf, I often find it's in Zotero twice, once linked to the proper bibliographic entry, once orphaned / apparently unlinked.
I have found the following workaround.
1. Uncheck "Sync automatically" in Zotero preferences and close the application.
2. Create two copies of your Zotero data folder with "-Backup" and "-Full" suffixes.
3. Open the Zotero application, select all items in your library, move to trash, empty the trash and close the application.
4. Using any folder/file comparison tool, compare subfolders of the "Storage" subfolder of the current data folder with that of the "-Full" suffix data folder.
5. Delete all sub-folders from the "-Full" suffix data folder that exist on both sides. Then, exit the folder/file comparison tool.
6. Delete the current Zotero data folder and remove the "-Full" suffix from the copy data folder.
7. Now, open the Zotero application.
If you are satisfied with the results then
8. Enable "Sync automatically."
9. Delete the "-Backup" data folder.
You are all done!
If something went wrong or you are not satisfied then
10. Close the application, delete the newly renamed data folder and remove the "-Backup" suffix from the other copy.
You are back.