All Kinds of Tech Support

KeePass Sync and Backup

If you have not been able to tell, I really like using KeePass. But up till now I have not been using it very well. I have been backing up my database manually, by copying the file. Also I have had several different versions on my various computers, because I never kept them synced together. I just spent the last week and a half going thru all of my passwords and updating them, as well as straightening out my user accounts at each place. Well over 300 passwords were changed. Next it was time to get them all synced across my network.
So I started investigating how to do it. There are several ways to do it. The first is manually, but the drawback to this method is what happened to me. If you are not diligent to keep all your systems synced with the master database, you end up with several versions. The next way is by using plugins. This is not as straightforward as it sounds. KeePass has plenty of plugins, but I am using version 2 pro, and there are fewer plugins to do this. But whilst investigating what plugin to use, I ran across another version and it is the way I went with. It uses what KeePass calls Triggers. It is a small set of instructions that you can program some small steps inside of KeePass. There are some parameters that can be used to either enable or disable these triggers. There is even a way to copy and paste in these triggers so that you do not have to actually set them yourself. I am including the triggers I use below. But first I will explain how I use them.
When I first open my database it checks with the master database that I have on a Raspberry Pi that I use as a file server. The two databases sync up. Then anytime my computer goes to sleep KeePass locks. When I unlock the database, it is treated as just opening up, so a sync happens again. Then every time I make a change to my database and save it, it also does a sync. Also I have KeePass set to lock the database when my system goes to sleep and to save any changes before it goes to sleep. This also counts as a save, so it syncs again.
I have all my systems using the same triggers, so my master database is always updated, and all the copies are also updated regularly. I am still trying to get it set so it only syncs when it needs to, but I am up against what the program is designed to do. But for now, too many syncs are better than not enough.
Here is the trigger file, I have edited out the local and remote locations. You will need to place your locations into the file then copy it to the trigger clipboard on KeePass.

trigger.txt file

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.