Can real-time backup corrupt zotero.sqlite?

edited December 14, 2018
If I set real-time backup tool to backup data folder after 30 seconds of idle time while I run Zotero, can this corrupt zotero.sqlite?


Thanks in advance.

  • Backup tools don't modify the files they back up, so no, that shouldn't be possible.

    It's possible, though, that it could back up the file while it's in an inconsistent state, such that a restored database would be corrupt. But as long as you're doing regular, automated backups, you should have a recent version that works and shouldn't worry about it. (And the backups of Zotero's automatic backups — e.g., zotero.sqlite.bak — will always be stable.)
  • Thanks for your answer.

    One more question:

    You said, the backups of Zotero's automatic backups — e.g., zotero.sqlite.bak — will always be stable.

    Does this mean Zotero always backup stable sqlite file?
    That is, if zotero.sqlite file gets corrupted, Zotero doesn't make the backup of if?

    I have used Zotero for 7 years without any error. However, nowadays my zotero.sqlite file sometimes gets corrupted. As a result I have lost some of my recent contents.

    I don't think it is due to the instability of Zotero. It may be due to my computer system(Windows 10+data folder in external HDD), because the error appeared after I started to use Windows 10.

    I'm checking everything to find out causes. In the meantime, I will use real-time backup tool to prevent data losses.
  • Does this mean Zotero always backup stable sqlite file?
    It means Zotero closes the database safely before making the automatic backup, and since the backup file isn't touched after that it won't be in use when the external backup runs.

    But it's still just a copy of the file, so if your active database is actually corrupted, the corrupted file will be copied.

    The most likely cause of corruption on an external drive would be unmounting the drive while Zotero is open.
  • edited December 15, 2018
    Thanks.
  • To backup my Zotero data I usually upload the sqlite file to my Mega.nz (it's a cloud storage) page in the browser, AFTER having closed Zotero (indeed here https://www.zotero.org/support/zotero_data#where_did_my_items_go it's written that "Before you copy, delete, or move any of these files, be sure that Zotero is closed. Failure to do so before moving these files can damage your data."). In practice, I drag and drop the sqlite file from the Zotero Data Directory folder to the Mega.nz webpage, meaning that the sqlite file gets copied on Mega.nz and is not moved away from the Zotero Data Directory.

    (Side note: I know this way of backing up the Zotero data is not the officially suggested one, but let's leave this aside. From today I'll follow the official suggestion to backup my entire hard drive--and thus the entire Zotero Data Directory folder--to an external device on a regular basis)

    Now, the problem is that I just forgot to close Zotero before uploading the sqlite file to my cloud storage. After realising this, I closed Zotero and reopened it, but everything seems fine, fortunately! Do you think that something could have been corrupted/damaged? How can I be sure this has not happened?

    Thank you very much in advance for your help!
  • No, there's no risk of corruption to your Zotero database.
    As dstillman says above, the *copy* of the database may be corrupted (though it's not very likely that it is) but making a copy of your database in an inconsistent state doesn't damage the database itself (which isn't changed at all), so the *worst* case is that this particular back-up won't work (though, again, in most cases it will even when taken while Zotero is running)
    (the page you link to is not about backing up but about restoring from an already precarious situation so extra care is warranted there)
Sign In or Register to comment.