Automatically Sync KeePass to Local Folder
I use OneDrive to sync my KeePass database sync to different computers. I usually have the current setup:
- The original copy of the database file in my OneDrive (monitored/synced) folder.
- A local copy of the database file on my local disk, which is not synced by OneDrive.
My KeePass application uses the local copy of the database file as it’s working copy. This means that I need to sync the local copy with the copy in the OneDrive monitored folder. This is accomplished using Triggers (see also my previous post).
Trigger
- Open up
Tools
→Triggers
. - Check
Enable trigger system
. - Press the
Add...
button on the right hand side. - In the
Name
field, enter a fitting name, such asSync DB 1
. - Ensure to check
Enabled
andInitially on
.
Event
- Change to
Events
tab - Press the
Add...
button on the right hand side. - Select the event
Saved database file
. - Set
File/URL - Comparision
toEquals
- Set
File/URL - Comparision
to the filepath to the local copy, e.g.C:\Local\Path\Database.kdbx
- Press
OK
.
Actions
- Change to
Actions
tab - Press the
Add...
button on the right hand side. - Select the action
Change trigger to on/off state
- Leave
Trigger name
empty - Set
New state
toOff
- Press
OK
. - Press the
Add...
button on the right hand side. - Select the action
Synchronize active database with a file/URL
- Set
File/URL
to the filepath to the synced copy, e.g.C:\OneDrive\Path\Database.kdbx
- Leave
I/O Connection - User Name
empty - Leave
I/O Connection - Password
empty - Press
OK
. - Press the
Add...
button on the right hand side. - Select the action
Change trigger to on/off state
- Leave
Trigger name
empty - Set
New state
toOn
- Press
OK
. - Press
Finish
.
Final
- Repeat steps 3 – 29 above for other databases you wish to open.
- Press
OK
. - Upon saving of the databases specified in step 10, the database should automatically synchronise.