Active zotero.sqlite on Synology?
Hi, I hope this is the right place for my question.
I'd like to set up my Zotero data directory inside a Synology cloud station synced folder. However, I have read that it is dangerous to put the .sqlite file inside a cloud-synced folder such as Google Drive, due to the possibility of corruption. Can someone explain in plain English what the danger is here? Also, perhaps someone who is knowledgeable enough could take a look at this white paper on the cloud station software: http://global.download.synology.com/download/Document/WhitePaper/Synology_Cloud_Station_White_Paper.pdf
Would be okay to keep the .sqlite file in a folder synced with this software?
Barring this solution, does anyone know any software that would, say, automatically send the .sqlite file from a local folder to another local folder which is synced with the Synology each time Zotero is closed? This would basically be the same, and possibly avoid the data corruption risk, since the synced .sqlite file would never be open and active. It would just get overwritten each time zotero was closed, then synced.
Hope my questions are clear, and someone has some insights for me! Thanks so much!
I'd like to set up my Zotero data directory inside a Synology cloud station synced folder. However, I have read that it is dangerous to put the .sqlite file inside a cloud-synced folder such as Google Drive, due to the possibility of corruption. Can someone explain in plain English what the danger is here? Also, perhaps someone who is knowledgeable enough could take a look at this white paper on the cloud station software: http://global.download.synology.com/download/Document/WhitePaper/Synology_Cloud_Station_White_Paper.pdf
Would be okay to keep the .sqlite file in a folder synced with this software?
Barring this solution, does anyone know any software that would, say, automatically send the .sqlite file from a local folder to another local folder which is synced with the Synology each time Zotero is closed? This would basically be the same, and possibly avoid the data corruption risk, since the synced .sqlite file would never be open and active. It would just get overwritten each time zotero was closed, then synced.
Hope my questions are clear, and someone has some insights for me! Thanks so much!
But, to answer what you asked, read what SQLite says about this in the aptly named How To Corrupt An SQLite Database File. No. See section 1.2 of the linked document. No. Let's say you have Zotero open on Computer A and Computer B and you've made changes to both. This is VERY common. It is a PITA as a user to remember to close one before working on the other and, even if you went to that effort, mistakes happen.
Close Zotero on Computer A. The changes made to computer A are now on your backup server. Great!
But now close Zotero on Computer B. What happens? B doesn't have the changes made to A. It can't, because it was open when those changes were uploaded. So B can still get pushed to the server, but that overwrites the changes that had been made on A.
I had an issue before where not everything synced properly with the server, and then when syncing down to a fresh install, items and attached files were missing, other information was out of date, etc. The point is, I just don't trust that my library will be in tact when restoring from the server. By keeping it locally, I know what's in my db file, and I can just replace it from a backup in about 1 second, no need to worry about servers down or lost access to my account. That said, I would like to take advantage of any means for automated local backup that won't compromise my db integrity. i.e. If the backup occurs when the .sqlite file is active (Zotero is open), it is my understanding that this can cause issues. Is there some way to avoid this? My thought was just to write a script that will run the file sync every time I close Zotero.
Sorry, didn't see the rest of your post. I only use Zotero on one computer. So I don't think what you say about Computer A and B would be an issue, but I certainly understand the concern for those using more than one computer.
Backup and sync are really two different things. Backing up a closed sqlite file (ideally, storing versioned backups) is effective at making sure you don't lose too much data. But no: there's no good way to turn this into a syncing mechanism. Sorry for that data loss. Zotero gives the status of a sync and there was likely an error icon on display next to the sync icon. It will likely be more noticeable in the future: https://github.com/zotero/zotero/issues/941 Again: it is certainly safe (and encouraged) to have backup software make a copy of a closed sqlite file (and ideally one that is versioned). This is a one-directional backup and does not allow for bi-directional syncing.
I personally do both: I rely (successfully) on Zotero's syncing to keep multiple computers in sync, but can restore lost files from a single computer if needed.
As for backup, just run standard backups, something like rsync+cron (i.e. essentially Mac Time Machine or the approximations on that on Windows) of the Zotero folder -- or, if it was me, the entire harddisk -- to an external HD (or a server). Yes, there is a chance that happens with an open database, but that's not much of a problem. In the very unlikely case that the backup of zotero.sqlite actually is corrupted when you need it, you have Zotero's automated backups of its own database, which is from the last time it was closed.
I suppose my best bet at this point is figuring out how to write a shell script (or soon bash when windows gets bash) to see when the zotero application closes, then run a little sync from my local dir to my local google drive dir.
I think this is where I have to start with this: https://www.google.com/url?q=https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindows%2Fdesktop%2Faa393250%28v%3Dvs.85%29.aspx&sa=D&sntz=1&usg=AFQjCNE6z_adceacPUDZwMC-8S9eVJ2LOQ Anyone know the next steps? I ask half in jest, but thanks if anyone can help!
If you want to be extra safe, you can decrease the interval and increase the number of Zotero's automated backups. They're created every 24 hours by default, but you can configure those with the extensions.zotero.backup.interval and extensions.zotero.backup.numBackups prefs.