How to merge two KeePass databases
The password manager KeePass supports an unlimited number of databases that users may use. Some users may use different databases to separate different account types, e.g., work and home accounts, others may use KeePass on multiple devices without any form of synchronization.
While it is relatively easy to use syncing, e.g., by placing the database file in a folder that is synced to the cloud automatically on all devices or by using plugins for the purpose, it may happen that password databases may have different entries.
KeePass includes powerful options to merge multiple databases. All that is required for that is that all databases are accessible on the same device and that KeePass is available.
Merge multiple KeePass databases
KeePass comes with built-in sync functionality. Users may sync databases using local files or using URLs. Before we take a look at the process itself, it is important to understand the synchronization logic of the application.
KeePass' synchronization algorithm merges matching entry levels when sync is invoked. The application uses the last modification date as the main data point when deciding about the recency of entries. KeePass keeps track of it automatically whenever an entry is added or modified.
The application uses its history feature when it merges entries. Assume that the same login is available in two databases, but with different passwords. KeePass will merge these and set the most recent username and password as the default after the sync process completes. All other entries are stored in the history, so that they are not lost and may be accessed when the need arises.
Note: it is recommended that you create backups of the databases as a safeguard. While it is unlikely that things will go wrong, it is always better to have a backup for restoration purposes.
- To get started with the merging of databases, open KeePass and load one of the databases that you want to merge.
- Select File > Synchronize.
- Decide whether you want to merge the loaded database with a local file (Synchronize with File) or with a remote file (Synchronize with URL).
- Just select the local file if you picked that option. KeePass merges the two databases and displays a short notification in its status bar about the process. If you see "Synchroniztion completed successfully", you are all set and everything should have been merged.
- The "by URL" option works similarly, only that you need to type the URL that points to the KeePass database file. You may also add username and password, in case access is restricted.
Closing Words
The built-in sync functionality is useful when it comes to merging two databases manually. KeePass users who want permanent synchronization of databases may check out the available plugins to do so.
Now You: how do you handle password databases on different devices?
KeePass Synchronize it is very useful function.
Unfortunately KeePassXC fork do not have it, so for synchronisation I still need to use original KeePass even that it is terrible on Linux…
https://github.com/keepassxreboot/keepassxc/issues/2937
From the official documentation:
Import / Export – KeePass
https://keepass.info/help/base/importexport.html
KeePass can import many password database formats directly (see top of this page). Additionally, there are specialized KeePass plugins available for importing more formats (like AnyPassword CSV, Oubliette files, PINs TXT, ZSafe files, and many more). Using these plugins, you don’t need to manually reformat the output of other password managers; you can directly import the exported files.
Synchronization – KeePass
https://keepass.info/help/v2/sync.html
Merge changes made in multiple copies of a database.
Advanced Synchronization Schemes
https://keepass.info/help/v2/sync.html#adv
Local?Master Synchronization.
https://keepass.info/help/kb/trigger_examples.html#dbsync
A synchronization scheme that prevents data loss when database files are overwritten by other applications (e.g. cloud storage service software), using a trigger.
Plugins.
https://keepass.info/plugins.html
There are plugins for more complex synchronization schemes, for example to synchronize only a subset of the entries.
Backup – KeePass / Wiki
https://sourceforge.net/p/keepass/wiki/Backup/
Thank Owl, for your earlier reply to my earlier posting. And this comment Is just what i needed.
Note: Plugins
KeePass has a plugin architecture and a variety of plugins are available.
Those plugins are produced by authors who are independent of the developers of KeePass itself.
Plugins have full access to the KeePass database, for that reason It should be noted that this could be a security risk.
Thanks, Martin, for a really great article again.
You are referring to the plugin page from KeePass to find a permanent synchronization of databases. Any suggestion on which one you prefer for not online storage?
I use databasebackup from Francis Noël https://keepass.info/plugins.html#databasebackup
> I use databasebackup from Francis Noël
https://keepass.info/plugins.html#databasebackup
Note: DataBaseBackup does not use KeePass’ I/O infrastructure, therefore the plugin is incompatible with most other plugins that are providing support for more protocols (like IOProtocolExt).
Hi, I don’t use any of these, as I don’t sync my databases.
I’m risk-averse with my password manager – don’t want any potential sync issues, unavailability, etc. So I chose to keep the “authoritative” copy of my KeePass database on my PC. I set up a tiny scheduled job that regularly copies it to Dropbox and Google Drive for read-only access with my phone, tablet, etc.
In KeePassXC (Linux) it’s Database-Merge from Database, version 2.7.0.
Merge it is not sync.
KeePassXC open db1 and merge with db2. Effect: db1 will have added all content of db2. db2 will not change at all.
KeePass open db1 and sync it with db2. Effect: db1 and db2 will be perfectly synced (file checksum of db1 and db2 will be the same).
Does KeePassXC support something similar?
Unfortunately not…
https://github.com/keepassxreboot/keepassxc/issues/2937
KeePassXC has merge function, but it is different from synchronisation.
I agree with the points made in this article (Martin).
I have been a user for decades from MS-DOS for work reasons and my curiosity.
However, now that my entire family has converted to a digital detox lifestyle, the iPad (iOS) is our regular device because of its convenient AirPlay function.
AirPlay is a feature that allows music, videos, and images playing on an iPad or other device to be streamed to other devices via a network in the yard.
When it comes to password managers, I never use those bundled with browsers or AV software, and I consistently use “KeePass Password Safe”.
For the iPad, I use Bitwarden.
https://www.ghacks.net/2022/03/22/keepassxc-2-7-0-update-whats-new/#comment-4518125
For synchronization between different devices, I use Bitwarden for consistency with KeePass Password Safe (manual import/export).
In my case, truly unique personal information (passport information, IDs and licenses, etc.) is managed locally only with KeePass Password Safe and excluded from synchronization with Bitwarden.
As information:
Technical FAQ – KeePass
https://keepass.info/help/base/faq_tech.html