Hi, I've been using KeePass for some years now, and there is one problem that in my opinion needs more attention. I am storing my database in a private ftp server, and sometimes it happens that the database gets corrupted, and it cannot be opened any more. These occurrences are not frequent, but they happen.
One happened to me yesterday, and to my deep shock I found out that the backup file next to the database file was over a year old. I searched the KP settings and database settings, I searched the FAQs, and found nothing about the backup option. But the old file is there, so it looks like the feature has been removed at some point.
I can understand the need to encourage people to make their own backups of the database. I do backups on my own, and that wasn't a great problem for me. It was a slight of a problem, because I don't do my backup frequently, so I have lost a few of the newest entries.
Anyway, I do think the lack of the backup-before-save feature is a bad thing. Why?
1. Because the file corruptions do happen, despite having checked all the "safe file handling" boxes in the settings.
2. Because if the file gets corrupted and then automatically backed up, the user will be screwed, unless they have a backup system that keeps old file versions.
3. Because user's custom backup solution is not able to detect when KP will write to the file, and create the backup of last known good state of the database.
4. Because almost every other program does this already (some of them keep a number of old files in case multiple save attempts fail), because it is a reasonable thing to do - a simple mechanism that provides basic protection against file corruption.
That is why I want to ask you to restore the backup-before-save feature.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you, I didn't know about triggers. Neat thing.
I definitely didn't use them before, as I got to know about the feature just now. Perhaps that backup of my database was created manually by me then.
I tried to configure a trigger to backup my database, but it doesn't work, perhaps because I am using FTP, and cp command does not get username and password as part of the file name (and perhaps I should use scp for that). I just made some tests, and {DB_PATH} returns only the path to the file, without the FTP server's username and password, so I cannot use it for calling another program that will copy the file. I looked into the placeholders guide, but I could not find anything that would help here. Any suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. I thought I could avoid hard-writing my FTP login and password in the script, but it's stored in the KP's settings in plain text anyway, so it will be fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the database is open when the trigger runs, you can store sensitive data (e.g. FTP credentials) in the database. See the section 'Sensitive Data' on https://keepass.info/help/v2/triggers.html
Best regards,
Dominik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I've been using KeePass for some years now, and there is one problem that in my opinion needs more attention. I am storing my database in a private ftp server, and sometimes it happens that the database gets corrupted, and it cannot be opened any more. These occurrences are not frequent, but they happen.
One happened to me yesterday, and to my deep shock I found out that the backup file next to the database file was over a year old. I searched the KP settings and database settings, I searched the FAQs, and found nothing about the backup option. But the old file is there, so it looks like the feature has been removed at some point.
I can understand the need to encourage people to make their own backups of the database. I do backups on my own, and that wasn't a great problem for me. It was a slight of a problem, because I don't do my backup frequently, so I have lost a few of the newest entries.
Anyway, I do think the lack of the backup-before-save feature is a bad thing. Why?
1. Because the file corruptions do happen, despite having checked all the "safe file handling" boxes in the settings.
2. Because if the file gets corrupted and then automatically backed up, the user will be screwed, unless they have a backup system that keeps old file versions.
3. Because user's custom backup solution is not able to detect when KP will write to the file, and create the backup of last known good state of the database.
4. Because almost every other program does this already (some of them keep a number of old files in case multiple save attempts fail), because it is a reasonable thing to do - a simple mechanism that provides basic protection against file corruption.
That is why I want to ask you to restore the backup-before-save feature.
There was never a backup before save feature. Maybe you used a trigger to create one?
See the Backup Wiki for more info.
https://sourceforge.net/p/keepass/wiki/Backup/
cheers, Paul
Thank you, I didn't know about triggers. Neat thing.
I definitely didn't use them before, as I got to know about the feature just now. Perhaps that backup of my database was created manually by me then.
I tried to configure a trigger to backup my database, but it doesn't work, perhaps because I am using FTP, and cp command does not get username and password as part of the file name (and perhaps I should use scp for that). I just made some tests, and {DB_PATH} returns only the path to the file, without the FTP server's username and password, so I cannot use it for calling another program that will copy the file. I looked into the placeholders guide, but I could not find anything that would help here. Any suggestions?
I use WinSCP via a cmd URL to copy the database manually.
You can turn this into a trigger easily.
cmd://"C:\Program Files\KeePass Password Safe 2\Plugins\IOProtocolExt_WinSCP\WinSCP.com" /command "option batch abort" "option confirm off" "open https://xxxx@xxxxx.com" "put -neweronly C:\Users\Paul\Documents\Database.kdbx /files/KeePass/Database.kdbx" "exit"
cheers, Paul
Thanks. I thought I could avoid hard-writing my FTP login and password in the script, but it's stored in the KP's settings in plain text anyway, so it will be fine.
If the database is open when the trigger runs, you can store sensitive data (e.g. FTP credentials) in the database. See the section 'Sensitive Data' on
https://keepass.info/help/v2/triggers.html
Best regards,
Dominik
That is a great idea. Thank you.