Merge multiple database files?

  • Neal

    I have approx. 7 database files (3 PCs and several flash drives and external disk drives)
    with various keepass DB files. I have been bad about keeping them in sync.

    What is the best method to merge all of these and end up with one synchronized DB?

    I read the docs about the 2.x built in sync function, and it seemed to deal with one existing
    open database, and then pointing at a second one to sync with. Do I just do this manual
    method sequentially with each of the other 6 database files, or is there a better way?



  • develop1

    I think the 2.x sync function is your best bet.

    It helps to know the sync function is a two way record level sync.
    what this means is all the insert/update/deletes of file "A" will be pushed to file "B" and visa versa.
    At the conclusion of the sync the two files match will each other.
    If the two files were at one time identical copies of each other I think you will find that after the sync the net effect will be exactly what you want.

    The sync process was intended for those situations where some time in the past you took your .kdbx file and copied it to one or more other devices.
    Over time you then performed insert/updates/deletes to one or more of these files.
    The purpose of a sync is to bring each of the files back into matching the contents of each other.

    When you perform the sync the file names do NOT need to match each other.
    But the master key that opens the two files does need to be the same value.

    If the two files did NOT share a common ansestor/edit point then its very likely that all the record ID's of each will NOT exist in the other (and visa versa).
    So for example if you had two empty .kdbx files and you manually created records in each and happen to have tried to manually make the contents of the records match each other.
    I would fully expect a sync in this situation to result in the two files having "duplicate" records.
    The duplicates would be unique record ids who's contents seem to be the same.
    If this is your situation then after the sync is done you would manually choose one record to keep and delete the other(s).

    you say you have 7 .kdbx files.
    I would make copies of all of them so your original files remain un-harmed.
    to keep things easy lets call the seven files f1,f2,f3,f4,f5,f6,f7.kdbx
    Make sure each of these seven files open with the same password value.
    now open up f1.kdbx
    sync with f2 at the conclusion of they sync f1 & f2 will match the full set of f1,f2
    now sync with f3 at the conclusion of the sync f1 and f3 will match the full set of f1,f2,f3
    now sync with f4 at the conclusion of the sync f1 and f4 will match the full set of f1,f2,f3,f4
    now sync with f5 at the conclusion of the sync f1 and f5 will match the full set of f1,f2,f3,f4,f5
    now sync with f6 at the conclusion of the sync f1 and f6 will match the full set of f1,f2,f3,f4,f5,f6
    now sync with f7 at the conclusion of the sync f1 and f7 will match the full set of f1,f2,f3,f4,f5,f6,f7
    at this point both f1 and f7 will match each other and contain the full set of all records.
    If your happy with the results you can copy these files to each of the remote devices naming them as you see fit.