Keepass2android: Proper use of dropbox with keepass2android & windows PC

Created on 20 Nov 2018  路  6Comments  路  Source: PhilippC/keepass2android

Hi Everyone!

Just want to make sure I'm using keepass2android properly in the following scenario

  • keepass2android installed on android phone
  • .kbdx database file stored on dropbox under the "keepass2android" folder under Apps.
  • Windows 7 PC also running Keepass(v2)
  • Have the windows PC also open the same dropbox file (under the "keepass2android" folder under Apps.)

Is it ok to have the windows PC open the .kbdx file under dropbox/apps/keepass2android? I Don't want to mess up keepass2android.

Can anyone confirm if this is the right strategy?

Most helpful comment

you don't need that in KP2A. KP2A is directly operating on the Dropbox file and will offer to merge (or overwrite) when saving and the remote file has changed.

Hi Philipp
It would be great if Keepass2Android each time it starts or is unlocked could check if the Dropbox file/database has changed (for example if it has been updated on a Windows PC). As it is now I have to manually select the 3 vertical dots in the upper right corner and then select to synchronize the database to see updates made on the on the Windows keepass2. I have already disabled the caching of the database (de-selected the 'Keep a copy of the database files in the application cache directory', but that didn't help).
Or am I missing a setting which can do the 'sync at start or unlock' automatically ?

All 6 comments

that should be fine. There is one use case where you might get file conflicts: If you open the file on Windows, then change it on Android and then change it on Windows (without reloading on the PC), Dropbox will create another copy of the file with another name. If that happens, you can use Keepass2's synchronize feature.
To avoid that, you can also setup something like https://keepass.info/help/kb/trigger_examples.html#dbsync

Perfect thanks for confirming I'm on the right track!!

Question, if I do go with triggers... I see this can be readily setup from the PC side. But don't see any options to set triggers under the keepass2android app itself? How do I configure a trigger from within the app?

you don't need that in KP2A. KP2A is directly operating on the Dropbox file and will offer to merge (or overwrite) when saving and the remote file has changed.

Oh that'd good to know ! So I only need the trigger on the PC side. Thanks Sir!

you don't need that in KP2A. KP2A is directly operating on the Dropbox file and will offer to merge (or overwrite) when saving and the remote file has changed.

Hi Philipp
It would be great if Keepass2Android each time it starts or is unlocked could check if the Dropbox file/database has changed (for example if it has been updated on a Windows PC). As it is now I have to manually select the 3 vertical dots in the upper right corner and then select to synchronize the database to see updates made on the on the Windows keepass2. I have already disabled the caching of the database (de-selected the 'Keep a copy of the database files in the application cache directory', but that didn't help).
Or am I missing a setting which can do the 'sync at start or unlock' automatically ?

You're doing it correct on the Android side; however there is a step you can take to ensure that you never run into sync issues or a database being overwritten by adding a Trigger to KeePass on your PC.

The setup for Android <--> PC sync should look something like this:

Android

In order to provide optimal security, you should not store a local copy of the database, instead opting to use your secure cloud storage, in this case Dropbox.

  • In Keepass2Android, load the database file: `~\Dropbox\Apps\Keepass2Androiddatabasefile.kdbx'

Changes made from your Android device are made directly to the file stored in the cloud.

This is all you need to do on the Android side, Keepass2Android operates under the assumption that you always have your database backed up locally somewhere in case of corruption.

PC

You want to store a local copy of the database on your PC and not rely solely on the Dropbox file. In the event some change is made, you always want something to revert back to. Setting up a trigger event allows you to open and work on a local database, save and sync it with the database on your Android device without running the risk of data loss.

  1. Copy/Create/Save your database file locally on your PC, for example D:\Backups\databasefile.kdbx
  2. In KeePass: Tools > Triggers. Ensure that "Enable trigger system" is checked.
  3. Add a trigger, DropboxSync. When editing it, check "Enabled" and "Initially on" to ensure that it always runs.
  4. Under the Events tab, add the following Events, in order, which define the local database:

    • Opened database file : Equals, D:\Backups\databasefile.kdbx

    • Application started and ready

    • Saved database file : Equals, D:\Backups\databasefile.kdbx

    • Time - Periodic : 3600, No

  5. Under the Actions tab, add the following Actions, in order, which define the sync path:

    • Change trigger on/off state : Off

    • Synchronize active database with a file/URL : `D:\Dropbox\Apps\Keepass2Androiddatabasefile.kdbx'

    • Change trigger on/off state : On

This ensures that you are always saving the database to a local file that cannot be changed by Android except through the sync process; you always have a backup in case something goes wrong.

These are truncated instructions from the KeePass Triggers section of the official site. You can learn a lot more about triggers, and perhaps find some useful ones there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wikholm picture wikholm  路  4Comments

Erwyn picture Erwyn  路  4Comments

Zhaph picture Zhaph  路  4Comments

GuillaumeCz picture GuillaumeCz  路  5Comments

tgp1994 picture tgp1994  路  4Comments