Menu

Dropbox and 'conflicted copy' of KeePass DB

Help
2015-09-24
2015-09-26
  • Frank Llopis

    Frank Llopis - 2015-09-24

    Hi!

    Environment:

    Follow the example in
    Synchronizing with Dropbox / other PC synchronization software
    http://keepass.info/help/kb/trigger_examples.html
    to enable several accounts on the same or different devices to use one
    KeePass DB content and keep it in sync.

    If you just googled this and want to implement this process
    stop reading this topic now and first read and implement the example above!


    Problem:

    Sometimes you will get 'Conflicted Copies' in the DropBox folder.

    Here is my interpretation of what is happening with possible solutions:

    At Login DropBox updates the Database file in it's local folder.
    And KeePass gets told to check for possible changes in the database
    located in the Dropbox folder by the 'Synchronize on Opening a Database'
    Trigger event.
    Reason: otherwise I would get the changes made by other instances only
    when I make changes in my local database which triggers the 'Synchronize
    on Saving a Database' event.

    Each time KeePass synchronizes the database it immediately saves the
    database too. Even if there was nothing to be done.
    So the 'Synchronize on Save' event triggers and synchronizes with the
    Dropbox folder again.

    If I was working with the logged in user as the latest user before this
    Login it is a change by 'the same user' so the most recent change
    supersedes the previous one. So no 'conflict' there.

    If I was working with another account and/or on another device
    Dropbox sees that as a version of the file changed by another user.
    If Dropbox is still downloading the database 'changed by another user'
    and KeePass writes to it at Login it results in a 'conflicted copy'.

    This is just how I understand the process. Any corrections and
    improvements are welcome!


    Possible solutions:

    • KeePass could (periodically) monitor the DB file in the Dropbox folder
      and synchronize when necessary.
      Perhaps configurable via a Trigger event.

    • KeePass could monitor the DB file in the Dropbox folder and optionally
      wait until a Write is done.
      So an additional 'Condition' entry.
      And an 'OR' statement to form something like 'File is written or 20
      seconds have passed'.

    • KeePass could write the DB in a more relaxed way.
      For instance make no changes in the local DB if the Synchronize with the
      file in the Dropbox folder says 'Nothing to do'.
      But most likely there are certain changes that happen automatically
      every time.

    • KeePass could write the DB a bit later so Dropbox has finished it's
      Download.
      One way could be a delayed startup of KeePass which is only possible
      with Third-Party tools.
      Another way is a Delay in the Trigger scripts in use. That is what I am
      doing now:

    Split the Synchronize Trigger in two almost identical events:
    One when Opening a DB and one when Saving a DB.
    Then I added a 'WAIT 5000' statement to the initial 'Open a DB' Trigger
    event. One has to adapt that to the time you need to unlock the DB, the
    size of your DB and your average download speed.
    Disadvantage: during all Delays KeePass is unresponsive so you can't use
    it to supply Login parameters.

    Any improvements on my laymen approach are welcome!


    Especially for new users the complete 'How to keep a database in sync
    over the cloud' is one huge pitfall waiting to swallow the users data.

    So maybe the Process in the examples
    Synchronizing with Dropbox / other PC synchronization software
    http://keepass.info/help/kb/trigger_examples.html
    could be made mandatory somehow?

    Regards,
    Frank

     
  • Paul

    Paul - 2015-09-25

    KeePass has no way to manage Dropbox conflicted copies, but it is not an issue anyway. See this thread: https://sourceforge.net/p/keepass/discussion/329220/thread/b9abf7c8

    cheers, Paul

     
  • Frank Llopis

    Frank Llopis - 2015-09-26

    Thanks Paul.

    But if I understand the linked Thread correctly the conflicted copies are an issue unless you continuously check for either

    • new entries in the History and/or
    • the existence of conflicted copies

    so you can synchronize manually an all devices with all conflicted copies after logging in with all users. And please don't waste any time. I am considering this an issue!

    And I didn't ask for KeePass to manage the conflicted copies.
    I made suggestions on how to avoid them as far as I understand this issue.

    I am still looking forward to suggestions on how to improve my theories.
    And ultimately in a slightly different way of handling cloud syncs.

    Regards,
    Frank

     
  • Paul

    Paul - 2015-09-26

    Conflicted copies are not an issue if you use the two database approach as suggested. The local KeePass copy always has its own changes and these will eventually make their way to the other databases via Dropbox, conflicted copies just delays the process until the next database save.

    cheers, Paul

     

Log in to post a comment.

MongoDB Logo MongoDB