How to merge two KeePass databases

Martin Brinkmann
Mar 25, 2022
Windows software

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 merge 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.

  1. To get started with the merging of databases, open KeePass and load one of the databases that you want to merge.
  2. Select File > Synchronize.
  3. Decide whether you want to merge the loaded database with a local file (Synchronize with File) or with a remote file (Synchronize with URL).
  4. 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.
  5. 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?

How to merge two KeePass databases
Article Name
How to merge two KeePass databases
Find out how to merge two databases of the password manager KeePass to synchronize all password entries.
Ghacks Technology News

Tutorials & Tips

Previous Post: «
Next Post: «


  1. Danniello said on March 29, 2022 at 1:32 pm

    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…

  2. owl said on March 26, 2022 at 7:24 am

    From the official documentation:

    Import / Export – KeePass
    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
    Merge changes made in multiple copies of a database.
    Advanced Synchronization Schemes
    Local?Master Synchronization.
    A synchronization scheme that prevents data loss when database files are overwritten by other applications (e.g. cloud storage service software), using a trigger.
    There are plugins for more complex synchronization schemes, for example to synchronize only a subset of the entries.

    Backup – KeePass / Wiki

    1. Paul(us) said on March 26, 2022 at 10:07 am

      Thank Owl, for your earlier reply to my earlier posting. And this comment Is just what i needed.

      1. owl said on March 27, 2022 at 1:31 am

        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.

  3. Paul(us) said on March 25, 2022 at 8:50 pm

    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

    1. owl said on March 26, 2022 at 7:17 am

      > I use databasebackup from Francis Noël

      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).

    2. Martin Brinkmann said on March 26, 2022 at 6:48 am

      Hi, I don’t use any of these, as I don’t sync my databases.

  4. BillD said on March 25, 2022 at 2:28 pm

    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.

  5. dave rader said on March 25, 2022 at 2:02 pm

    In KeePassXC (Linux) it’s Database-Merge from Database, version 2.7.0.

    1. Danniello said on March 29, 2022 at 1:34 pm

      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).

  6. Anonymous said on March 25, 2022 at 12:16 pm

    Does KeePassXC support something similar?

    1. Danniello said on March 29, 2022 at 1:39 pm

      Unfortunately not…

      KeePassXC has merge function, but it is different from synchronisation.

  7. owl said on March 25, 2022 at 7:50 am

    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.

    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

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.