Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Merge #22

Closed
TheZ3ro opened this issue Oct 3, 2016 · 16 comments
Closed

Database Merge #22

TheZ3ro opened this issue Oct 3, 2016 · 16 comments
Milestone

Comments

@TheZ3ro
Copy link
Contributor

TheZ3ro commented Oct 3, 2016

Should be nice to be able to automatically merge 2 or more password databases.

Use case: You have a KeePassX database on your PC and a database on your Phone, you "sync" them with Syncthing, Dropbox, whatever and you will lose changes on PC or Phone version so you need to keep both databases aside. With the Merge feature, you open both database on KeePassX and merge them so now you have all password in 1 file.

@droidmonkey
Copy link
Member

So the use case is you open two databases in the app then hit the "sync" button which will compare timestamps across entries and reconcile them into one database that you can then save.

Did I capture that correctly?

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Oct 4, 2016

Yes, or maybe just opening 1 database, hit a "Merge" button and select another database file to compare to

@ImNtReal
Copy link

ImNtReal commented Oct 6, 2016

KeePass calls this Synchronize. For instance, I have one .kdbx file that I synchronize to multiple machines using NextCloud. I'll have that file open on each machine, and when a change is made, the new file is automatically copied across all the machines. In KeePassX, I have to close the database, and reopen it to see the change. In KeePass, I go to File -> Synchronize -> Synchronize with File, and select the file. It will then merge changes.

It would actually be even cooler if you set up a watch on the file, and merged it any time there was a change that KeePassX didn't make to the file. Truth be told, in my setup, since I have KeePassX set to auto-save on change, I wouldn't even need merging, I would just need the database be automatically reloaded when it changes outside the program.

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Oct 6, 2016

So:

  • Option to Merge current Database with another file
  • Option to Sync (on changes) from another file
  • Automatically Sync (on changes) from the opened database file

@ImNtReal
Copy link

ImNtReal commented Oct 6, 2016

I think it's really just:

  • Option to Merge current database with a file (whether it's the current file or a different one)
  • Automatically merge the current database when it changes

Obviously, the second bullet could be a separate request if the first one is done, but it may be easier if it's designed with that in mind from the beginning.

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Oct 6, 2016

By Merge I mean, the user request to merge 2 file by clicking a button by demand
By Sync I mean, if user enable this option KeePassX will check for change and do the Merge

I think that 1st and 2nd (from my comment) are different behavior
The 3rd is like the 2nd but done automatically by KeePassX without user choice on the currently opened database file

It sounds good?

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Oct 6, 2016

I was developing the Automatic merge of the current database file and I've learned that KeePassX put a lock on the file if it's open. It's a good idea to discard the lock (maybe only when the database is not used) and enable the auto update?

@droidmonkey
Copy link
Member

droidmonkey commented Oct 6, 2016

Database merge was proposed by @monomon in KeePassX PR #177

I merged this code into a feature branch

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Oct 6, 2016

Current status

  • ✅ Option to Merge current Database with another file
  • Option to Sync (on changes) from another file
  • ✅ [https://github.com/Detect background changes to database file. #33] Automatically Sync (on changes) from the opened database file

@droidmonkey droidmonkey modified the milestone: v2.1.0 Oct 13, 2016
@droidmonkey droidmonkey mentioned this issue Oct 18, 2016
1 task
@tlaerm
Copy link

tlaerm commented Oct 21, 2016

Oh wow, I can't wait for this! Thank you guys so much. I have a nextcloud setup as well to sync my stuff across different machines and this will make it complete.

@monomon
Copy link

monomon commented Nov 4, 2016

I would love to see this change in the reboot. It is kind of unfortunate that the original project is not active.
Indeed the change so far only merges another file into the currently open one. Watching files and syncing from a remote provider would be interesting, though.
tbh one of the reasons I use keepassx is that I do not want to store my database "in the cloud". But syncing securely p2p would be fine.

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Nov 4, 2016

Almost any Cloud (Dropbox, GDrive) or Sync (Syncthing) provide a program that sync a folder on your pc with the cloud/remote version. You don't need to set the watch on the remote provider. Just watch the file that the program will sync.

@monomon
Copy link

monomon commented Nov 4, 2016

Yeah sorry, wasn't clear enough but wasn't conflating the two :)
I meant them as separate use cases.
Watching a file synced from the cloud would be tricky, you could easily get unresolvable conflicts (assuming concurrent work on the same file). Would you do a deep merge of some sort then?

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Nov 8, 2016

This is closed but there is still an Issue/Feature request to complete:

  • Option to Sync (on changes) from another external file

@droidmonkey
Copy link
Member

I think we incorrectly grouped three features into one issue. Can you open up a new issue to capture that feature?

I'll be opening a PR for the autoreload feature this evening.

@TheZ3ro
Copy link
Contributor Author

TheZ3ro commented Nov 8, 2016

Done https://github.com/keepassxreboot/keepassxc/issues/90\

OT: Can you review the "Mac-Windows Autotype PullRequest" when you have spare time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants