Sudden loss of entire Library in Zotero Standalone
Hello,
I bought a new Windows laptop on Monday, restored my Zotero library from a backup and installed Zotero Standalone. I set up my usual custom data directory, so that my references could be regularly backed up to the cloud.
Everything worked well for three days, and I reorganised plenty of references yesterday afternoon, followed by a sync and cloud backup.
I opened Zotero Standalone this afternoon, and my library is empty. The zotero.sqlite file in my custom data directory has reduced to 1,000 KB.
Thankfully, I can still access my references by logging in to zotero.org, but I am wary of syncing, in case the empty data directory will be copied to my Zotero account on the web, losing all my references.
I look forward to your help.
Thanks and best wishes,
Elizabeth
I bought a new Windows laptop on Monday, restored my Zotero library from a backup and installed Zotero Standalone. I set up my usual custom data directory, so that my references could be regularly backed up to the cloud.
Everything worked well for three days, and I reorganised plenty of references yesterday afternoon, followed by a sync and cloud backup.
I opened Zotero Standalone this afternoon, and my library is empty. The zotero.sqlite file in my custom data directory has reduced to 1,000 KB.
Thankfully, I can still access my references by logging in to zotero.org, but I am wary of syncing, in case the empty data directory will be copied to my Zotero account on the web, losing all my references.
I look forward to your help.
Thanks and best wishes,
Elizabeth
do you sync that folder to any other computer or just up to whichever cloud service you're using?
All sqlite.bak files are 1MB.
I sync the folders to a cloud backup and then to a smaller portable device.
You can do reset from server in the sync/Reset tab of the Zotero preferences (make sure you pick the right direction of reset) to be 100% safe, though in all likelihood you're just looking at a fresh database and regular sync would work just fine.
If you're using a well-set-up cloud service, you may also be able to look at file version history online to do some detective work of where the database was changed and how.
1) I have some recent backups of the Zotero directory, from 6 December when my old laptop backed up to the cloud (the SQLite files are 92.88MB on this version) and an earlier version from mid-November on an external drive. If I downloaded those files or synced them to my new laptop, I could restore a recent version, and then hopefully sync with the new data on the server. Would that work?
2) If I do a regular sync, could the empty Zotero library be synced to the server, deleting all my references?
3) The preferences menu mentions that resetting data from the server can cause difficulties. Is that also a high risk approach?
I don't use Dropbox, and have a number of backup strategies, but they do not seem sufficient at the moment!
Thanks for your help.
1) actually seems like the easiest option here and I don't see any risks at all, so I'd go with that.
I'd still try to figure out what happened. I realize you're not using Dropbox, but for the purpose of syncing a database, Dropbox and pretty much any file sync service are roughly functionally equivalent (most use about the same technology, some variety of rsync, under the hood). Using it to sync your Zotero database in any setup that involves more than one device and the cloud is a bad idea.
I will try to remove my Zotero data directory from the cloud sync, but I need advice from my cloud backup provider on how to do this. The Changelog from the backup software indicates that the 96.55MB versions of zotero.sqlite and zotero.sqlite.bak were both deleted this afternoon during a sync, so it does seem that the cloud backup/sync software caused the problem.
Thank you again for your help.
Most likely your database got corrupted, Zotero automatically made a backup of the damaged DB and reverted to a clean database, and then Zotero synced down what was on the server, but you hadn't successfully synced in a couple months. (The last upload I see from you was at the end of October.)
I tried repairing the sqlite file (ID 567d4e686fae3), but nothing changed -- I only see some 80 references in my library. Is there any way you can see the content of the October upload?
Should I try updating the Zotero Standalone?
When you previously were using Zotero, was that on the same computer? Also with Standalone? Could the message have said something about sharing the data directory with Firefox?
Yes, I was using the Standalone on the same computer. Nothing has changed except that Firefox was probably updated a few times. Yes, the error message might have said something like this, but I unfortunately did not get to read it fully as I clicked by mistake and then it was gone :(
Another possibility might be that you somehow started a new data profile. Could you check what it says in the Advanced Tab of the Zotero Preferences --> Files and Folders under "Data directory location?" Is default checked, or does it specifcy a custom location (which)?
Is there any way to retrieve (on your end or mine) the library which was synced in October? I am not interested in the files, as I had not uploaded many, just the hundreds of references.
https://www.zotero.org/support/zotero_data#troubleshooting_zotero_data_issues
It doesn't look like you've uploaded anything to the server in over two years, so you'd have to find the data locally.
Unfortunately, despite the automatic sync option checked in Zotero, my data were not synced with the server, but the sync was done from the server to my laptop, overwriting everything I had locally.
Is there any way to see the sync history or revert to an older online backup prior to Dec 24, 2015? A good feature request would be sync versioning with rollback options both locally and online.
- checked the Event Viewer for any issues regarding Zotero to see the error message from failed application start on the evening of Dec 24, but I didn't find any references to that event in the Windows Event Log. After selecting "Quit Zotero" in the error message and finally starting Zotero Standalone that evening, it loaded an old database with 80 records (where there should be hundreds more).
- checked Zotero sync options -- they were enabled the whole time.
- there were no .crashed files in the Zotero directory, but there is a store.json.mozlz4 file in the /crashed directory; however, the Zotero extension for Firefox was not used for months and there is a possibility that an automatic Firefox update from a few weeks ago disabled the Zotero extension.
- there are no multiple zotero.sqlite files on my computer. The only .sqlite and .sqlite.bak were in the defined (default) data directory so the issue is not coming from fiddling with the wrong database.
- I did not use Zotero on any other devices except for this laptop, so we can also exclude the possibility that the library was overwritten from another device.
- the Zotero Standalone data folder was not set up to any 3rd party cloud backup such as Dropbox, GDrive, Box, etc. It was only expected to sync with Zotero's online database.
- I backed up all of Zotero Standalone's profile files and the database was made before recovery attempts. I tried to restore the zotero.sqlite database and the zotero.sqlite.bak file, after the crash, but it seems that both files are actually the same, synced from Zotero's server.
- I also used my friend's computer (Zotero MacOSX) to try to restore the .sqlite and .sqlite.bak databases from the date of crash -- without sync options enabled -- and it seems that the database corresponds to what I have on my laptop and what is on Zotero's server, leading to the conclusion that my laptop synced with the server and downloaded what was in the library while overwriting my local data.
Literally years of research just vanished after an unwanted sync push. So, it appears that uploading from Standalone to Zotero online works (so we can rule out that a firewall or antivirus rule might block it the upload), however, the question is, with the sync enabled the whole time, why the local copy didn't update all the changes to the server's online database in over two years?
Also, could you verify that both Zotero for Firefox and Zotero Standalone share the same data directory? (follow Dan's link above for instructions; for Zotero for Firefox, make sure Zotero Standalone is closed, then start Firefox and open Zotero from within Firefox, and look up the data directory via the Zotero preferences; for Zotero Standalone, just open Zotero Standalone and do the same)
One other possibility that occurred to me: Any chance you have a 2nd Zotero account and you're logged in (and synce with) the wrong one? We do see this surprisingly often.
What you suspect as having happend is incredibly unlikely to be the case. Zotero sync doesn't just overwrite local data -- it only ever deletes items when either
a) you have explicitly deleted the items or
b) you explicitly use the reset options in the sync preferences.
Neither of these sounds like is the case here.
Also, for the worst case, don't you have a backup of your harddisk for prior to the 24th? That should make restoring pretty easy.