marvinweber / KPSimpleBackup

KPSimpleBackup - Backup Plugin for KeePass2 (compatible with IOProtocolExt)
GNU General Public License v3.0
129 stars 8 forks source link

LTB Backups: Save database only once, copy for LTB #28

Closed marvinweber closed 3 years ago

marvinweber commented 4 years ago

If LTBs are enabled, KeePass has to save the database up to four times.
It migth be faster to save the db once, and copy the resulting file to the other required locations.

Todo: Evaluate, if this actually does improve the performance (also, if it does not significantly worsen the perfomance, if LTB is not used)


Solution: Database is only saved once and copied afterwards for LTB backups. However, the "normal backup" should still be created by saving the database (using the api provided by KeePass) to ensure compatibility with the IOProtocolExt protocol.
Also, it should be implemented in a way that it either can use the previous normal backup file for copying to LTB or save the database in a temporary file from which it is copied to LTB (this allows using the LTB feature without having to do a normal backup before; this might be useful in the future).

marvinweber commented 3 years ago

The LTB backup files are now copied from the normal backup file instead of saved each separatly. This is about ~3,5 times faster than before (for my test file: instead of 4693ms in average, the backup process only takes 1282ms in average).

The implementation still allows to use LTB without a normal backup before. In this case, a temporary file is exported from the database and used for copying.