Menu

#1232 show changes when synchronizing

open
nobody
5
2023-07-03
2009-07-16
alm2k
No

When synchronizing two databases, it does not show what is changed, would it be possible to show this information (perhaps even before applying them)? A summary would be ok as well, as long as all can be recoverable through history. Ofcourse one could keep backups, but it makes things more complex for the user.

Discussion

  • J. B.

    J. B. - 2017-05-01

    Just tried to reply to #2179 dated September 2016, but found out it was closed.

    Hi,

    Because of the way I use KeePass it is extremely rare that I ever find my databases in conflict, partly by design, partly by dogged consistency.

    I was inconsistant this weekend.

    Although I've wanted the ability to "compare" two databases for a very long time, mostly as a sanity check, this time I really screwed up, and the ability to compare two databases, perhaps even selectively merge, would be a godsend.


    First a little background before I grovel... :-)

    My use-case for KeePass is as follows:

    1. My KeePass database "master" copy is on Dropbox. My key file is not.
    2. When I need to use a new machine, I...
      • Install Dropbox and let it sync, placing a copy of my database on the new machine.
      • COPY the database from the Dropbox folder to a different location not controlled by Dropbox
      • COPY the key file manually, usually from a USB drive which has the key file, but NOT the KeePass database. The key files exist only on machines I control, or offline in a locked firesafe
      • Set up a trigger to, at the push of a button, sync the local copy with the Dropbox copy

    The Dropbox copy is only ever accessed while synching, a few seconds at best, and sometimes days will pass without the need. Synching is manual, not automatic, so synchs only happen when I decide they do. A batch process running hourly probably would work fine, but I've not found the need. Another thought would be an exit trigger (my KeePass instance closes after a period of inactivity, saving on exit), but not really an issue for me.

    For the visually oriented...

    PC1-HD | KPDB < - - > Dropbox (folder) KPDB < - - > PC2-HD | KPDB (or USB or smartphone...)

    (* - local copies not directly affected by Dropbox; I also synch with networked shared drives)

    I never worry about locks.

    As for security, Dropbox can't see the contents of my database. And even if my account were compromised (or handed over to the female body inspectors), and even if they figured out my 19 character password, my database still can't be opened without the key file which never goes in the cloud.

    I find the balance of security and convenience ideal for my needs.

    Sometimes, Dropbox decides it can't synch a copy of the database, and it generates something like COMPUTER-conflicted-copy-KeePassDatabsae.kdbx. I simply synch with it, then synch with the "cloud" master database, and delete the "conflicted" copy (the synching ability of KeePass is the single best and most important feature of any password manager to me).

    Now, my problem...

    I added a bunch of new entries on Friday, and were they ever tedious. Besides username and password, there is also "workspace" and "schema" for each of the admin, developer and user entries. And there are two sets on different machines, differring in name by just a few characters.

    Ordinarily, as soon as I get home and boot up, I synch. This weekend, I forgot.

    Problem is, not only did I forget, apparently I had Dropbox turned off.

    This weekend I signed up for a number of services. My passwords are all there, in my out-of-synch database.

    The other aspect of my use-case is that I only know one password. Literally. I generate 12-15 character passwords that contain a minimum of 2 upper, 2 lower, 2 numeric and 2 "special" characters. I never look at them, or pick them. They are generated randomly, and I paste them into the dialog for the service I am registering, and never even see them.

    As of this morning I have 2,100 entries in my database, which is 7.99MB.

    Today, I was trying to log in remotely on the train, and started having problems. There were old entries in the database, similar enough that I didn't notice that the new entries I labored over on Friday weren't there. Worse still, I started making changes trying to straighten out the "mess", only to create a bigger one.

    I now have two out of synch databases, that without doubt will break one another if I try to synch. Its possible (likely) that the new accounts will survive a merge, but of course healthy paranoia says otherwise.

    OTOH, the new entries I made on the train are most certainly now newer than the "good" copy, and will overwrite all the new ones created Friday.

    By carefully keeping multiple backups, with detailed documentation, I could just synch and rely on being able to find any missing entries down the road.

    But what I'd REALLY like to do is merge the out of synch databases and cherry pick which ones supercede the others.

    I could do that manually quite easily, because of the amazing way I can copy and paste entire entries from one database to another (have I mention lately that, after my Wife and my son, I love KeePass more than anything on Earth?).

    The missing piece is knowing which is which. Again, modification date and time stamps will go a long way toward that.

    But it will still be a manual, and error-prone task.

    What is it I desire?

    Level 1, the simplest solution (and perhaps this could be done easily as a plug-in) would be to extract a list containing the group, name and timestamps from both, then compare the lists to see which items differ (I've actually thought about taking a crack at writing this myself - I'm a developer - for doing exports, etc.).

    Level 1a would be to add a function similar to the synch function, but that doesn't merge, but only compares two databases and reports its findings.

    Level 2 would be to list the actual data elements by which entries differ (password, user name, note contents, tags, etc.).

    Level 3 would be to pop a dialog with all the above that lets you choose to duplicate, overwrite or ignore (or "delete"?) whichever entry offends me.

    Mandatory shameless flattery: KeePass contains my life. I don't simply store passwords, I use it as a safe filing cabinet with anything I could ever to consider to have value. Contact data (name, address, phone), important information like house and room dimensions, product model numbers, photos, etc. I even keep PDF copies of reciepts for some things.

    I literally could not live without KeePass, and I consider the development and maintenance of it to be one of the most valuable and essential services on the Internet today.

    Thanks for listening!

    Jim

     
  • wellread1

    wellread1 - 2017-05-01

    But what I'd REALLY like to do is merge the out of synch databases and cherry pick which ones supercede the others.

    I could do that manually quite easily, because of the amazing way I can copy and paste entire entries from one database to another (have I mention lately that, after my Wife and my son, I love KeePass more than anything on Earth?).

    The missing piece is knowing which is which. Again, modification date and time stamps will go a long way toward that.

    You may have overlooked a few features that will allow you to manually reconcile the two databases.

    1. The last modified date and time of entries can be displayed and sorted in the Entry List pane.
      • Select View>Configure Columns...>Last Modification Time.
    2. Entries can be sorted by last modification time across the entire database irrespective of the groups they are in.
      • Set View>Grouping in Entry List to OFF
      • Select Edit>Show Entries>All
    3. Multiple KeePass instances containing separate databases can be displayed side by side. Side by side comparison of entries in the two KeePass instances is convenient if the group pane is reduced by sliding the divider pane to the left. If necessary it is possible to copy and paste between the databases in displayed in each instance.
      • Uncheck Limit to single instance in Tools>Options>Advanced(tab)>Start and Exit(section)

    A possible procedure:

    Open a copy of each database in a separate instance. Designate one database as the final database that will contain the final version of every entry. Arrange the KeePass instance windows so that they are side by side and they show all entries in the respective databases sorted descending by Last Modification Time in each.

    Manually inspect the suspect pairs of entries to determine which instance contains the desired version of the the entry. If needed, manually update the entry in the final database to the final version. (If the alternate database contains the most up-to-date entry and it contains too many differences to manually update the final database you could copy the entry to the final database. Keep in mind this copying does not merge entries, it creates a new entry.)

    When you have completed the process above, the final database will contain final versions of all entries. It is likely that the last modification time of the final versions of the entries will also be the most recent but it is not guaranteed. For example you may have edited an entry in the alternate database and decided not to carry the modification back to the final database. The problem can be resolved a couple of ways.

    • Permanently retire all copies of the alternate database so that it cannot be synced with the final database. Alternatively change the Master Key of the final database so that it cannot be synced with earlier versions.
    • Deliberately modify all inspected entries in the final database so they are guaranteed to be the most recent version of the entry. The last modified time can be updated in a batch operation using KPEnhancedEntryView plugin with the following procedure:

      • Select the entries to modify
      • In the Entry pane add a new "merged" string field containing some data (e.g. todays date).
      • Save the database

        The Last Modified time field for all of the selected entries is updated to the current time. The procedure also permanently marks all the entries that were reviewed. Alternatively, delete the new field.
     

    Last edit: wellread1 2017-05-01
  • T. Bug Reporter

    T. Bug Reporter - 2017-05-01

    Just tried to reply to #2179 dated September 2016, but found out it was closed.

    The fact that it's closed shouldn't have stopped you from posting there (unless that's a new SourceForge feature); did you actually try, or just assume you couldn't?

     
  • Paul

    Paul - 2017-05-02

    The KeePass sync only compares UUID and date, then adds the most recent item and moves the existing to History. Anything else would need a plug-in.

    If you use the side by side compare method you could add a tag to entries that you want to keep, export those tagged items to a new database, then sync it with your master database.

    cheers, Paul

     
  • Michael Shulist

    Michael Shulist - 2022-04-28

    I recently entered #2717 because after having read this ticket (and a few others) it seemed like a related, but simpler, request. Not highlighting merged records seems to be an issue that could be easily fixed by tagging the merged record with a tag such as Conflict_YYYY-MM-DD. It would solve a lot of problems that syncing seems to cause and are very difficult to find and fix.

     
  • wellread1

    wellread1 - 2022-04-28

    It would solve a lot of problems that syncing seems to cause and are very difficult to find and fix.

    What problems are hard to find and fix?

    When two databases are synced the result is the most up-to-date version of the database that can be created from the two database copies, i.e. each entry and group is the most up-to-date version of itself given the two input database files. When is that NOT the preferred outcome?

     
  • Paul

    Paul - 2022-04-29

    Please don't repeat requests, especially as you know it has been looked at.

    cheers, Paul

     
  • vertigo

    vertigo - 2023-07-03

    Created another issue about this as I didn't find this one when searching (the search function here is not good). Here's what I said there:

    As much as I'd like to be able to just trust that everything is working perfectly when synchronizing two database files, I can't, and I have concern that I'll end up losing something. This means I have to keep copies of the pre-sync'd files, made more challenging by the fact it doesn't create a backup copy and just overwrites the file. So not only does it not show what it does, but even if I wanted to try and check myself (which would be painstaking considering the number of entries), I'd have to pull a copy from a backup.

    So this request is for two things:

    1) Don't modify/sync the file without first making a backup, at least optionally, and
    2) Show the results of the sync afterwards, detailing each entry added/deleted/modified, including what was actually changed within the entries, to allow users to verify the sync is performing as expected.

    As for the plugins for backing up that were mentioned there, I don't need that, as I do my own backups of everything, not just this. But my point is that backups shouldn't be required (yes, they should always be done, but that's besides the point). It should automatically, at least optionally, create a copy of the database before syncing it in case something goes wrong.

    As for using the roundabout way of adding a column just to be able to sort with it to see what was changed, not only should those extra steps not be necessary, with it just showing a summary of changes instead, but it doesn't even work. I added the column and sorted it and the entries that were sync'd are not at the top (or bottom). And even if it did work, it still wouldn't be obvious what exactly was changed. Ideally, it should show each modified entry with the entry's contents before and after the change, highlighting (or only showing) what actual content was changed, similar to using WinMerge to compare two text files.

    Of course, considering this has been an open issue for 14 years, I'm assuming it's not actually going to happen, which is a shame. KeePass is, IMO, the best password manager, but it's one weakness, and what, in my experience, is the biggest detractor from people using it, is the inconvenience of having to maintain database files all over the place, and while being able to sync them certainly helps with that, not being able to verify that it's doing so correctly is a serious problem and hindrance.

     

Log in to post a comment.