-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What "Safely save database files" means? #1724
Comments
If you have to ask, don't touch it 😉 Safe saving uses a temporary file in the same directory as your current database which is closed and written prior to deleting your existing db file and then renamed to your filename. This makes it a transaction that prevents data loss 99.9% of the time. Unsafe saves use the temp directory to make the new database. Then your old db is deleted and the temp db moved in its place. Dropbox has a nasty habit of taking ownership of new files that prevents us from renaming the temp db in the same directory as your current db. |
Thanks for explaining, I was wondering the same thing. I tracked it down via the CHANGELOG document (where it's listed as "allow unsafe saving") to Issue #1385 . So, per that issue, the failure mode (after three failures) is a popup prompting one to disable safe saving. This is good to know (I'm using a database each on Dropbox and Google Drive File Stream, and haven't noticed any problems). P.S. There was also some discussion of the "atomic save" terminology. This is indeed technical: atomicity comes from database systems design, and means "all or nothing" of the operation succeeds -- the "A" of the ACID properties of database transactions that serve to guarantee a database works as expected. In our case, the transaction is the save of the keepass database. |
Well, considering it says "may be incompatible with Dropbox", I think it's quite reasonable that someone who uses Dropbox might ask what it does since they might need to "touch it". |
It was a joke. |
@droidmonkey in hindsight it would seem obvious since you used the winkey smiley. Unfortunately that is an attitude actually held by many people on the interwebs. |
I've been using Keepassxc (and before that keepassx) along with dropbox for a couple of years now and haven't faced a single issue. PS: I use a Linux system, and the dropbox linux agent for syncing with dropbox. |
Sorry, feel like a dolt for having to ask this even after reading this thread ... but what's the recommendation here? I used to use keepass 2 with triggers to deal with Dropbox syncs to avoid the "conflicted copy" thing. Should I leave "safely save" checked or should I uncheck it because I use Dropbox? It wasn't clear to me that either would work 100% of the time. Which is actually better if you use Dropbox. Should I just use google drive instead and forget about it? ;) |
Google drive has recently moved to the same behavior as dropbox... So maybe we should all go to OneDrive... The choice is really yours, I prefer safe saves just to be sure and will shutdown drive sync if it starts acting up. Unsafe saves are risky if you lose power or whatever in the middle of the file move. |
onedrive = MS only. doesn't work for us linux folk. I'll stick with safe and see how it goes. I make changes to the DB fairly rarely ... so it seems actually unlikely that I would get hurt by a bad save. ( and in that case, I would have copies/backups on DropBox in anyway, so should be easy recovery ) |
https://github.com/skilion/onedrive OneDrive Linux client, just in case one wants it. |
What about using an alternative temp directory like /var/tmp, which won't get wiped on system restart? |
We use the temporary file construct from Qt. We don't decide where the temp directory is. |
Reviving this thread for a follow-up. What's the format/extension/regex of the temp name? Could be added to the ignore list of cloud sync client (can't remember if dropbox has this, but owncloud/nextcloud do). |
Quick update for those interested, found extension here |
If you ignore that extension then you are ignoring the automatic backup of your database. Although if you are saving to cloud you should just disable backup database on save since you have version control. |
Hi @droidmonkey I misread. I was under the impression that the .old.kdbx was the extensions used by the temp file construct from Qt. I just reread that section of code and see you're right, it's just the backup of the db. I believe the recent problem I'm having (has worked without issue for years now) is related to the server config running my cloud. A mismatched hash problem. |
Wanted to confirm here, there should be no issues here when using Syncthing, Nextcloud, or Rsync to keep this enabled correct? |
Keep it enabled |
There is a checkbox in settings which is "Safely save database files (may be incompatible with Dropbox, etc)".
I could not find any documentation about that, so I will just ask here.
What does "safely save" mean? How does that affect Dropbox?
The text was updated successfully, but these errors were encountered: