A merge tool for KeePass databases
v1.0.7
Two KeePass databases in. One new database out.
You give Passbank two KDBX files. It lists what differs between them, you pick what the result keeps, and it writes a new file. The two files you gave it are never changed.
go install github.com/rm4n0s/passbank/cmd/passbank@latest

Two panels, A and B. Choose a file or drop it on the panel, type the password, and the panel shows what the file is.
Every change with its kind and its choice. Select rows with the mouse or the arrow keys, and set them with a button or with one key.
The two versions side by side. What differs is highlighted, and a password stays masked until you press Show.
5 versions
of KDBX are read and written, 2.x, 3.0, 3.1, 4.0 and 4.1, in any combination
7 kinds
of change, each with its own choices and a default that you can see
2 programs
on one core, a command line and a desktop application
0 connections
to a network. The process opens none, and there is no cloud
Your databases are never changed
The result goes to a new file. An input is never the output, and a file that exists is replaced only when you ask for it.
Nothing is decided in silence
Every difference between A and B is listed. You choose, or a default applies that you can see. By default the newer version of what differs wins, and everything that exists on one side only is kept.
Every write is verified
Before the new file is put in place, Passbank reads it back with the same credentials and compares it with what it meant to write. A file that fails the check never reaches the output path.
A plan you can read and edit
passbank diff writes the choices to a text file, one line for each change, with a comment that says what the change is. Edit the lines you disagree with, and give the file to passbank merge. The desktop application loads and saves the same file.
- The plan never holds a password or any other value of a field
- It names the two inputs by their SHA-256, so a plan that was made for other files is refused
--no-titlesleaves the group paths and the titles out of the comments- A plan that misses a change, or names one twice, is refused
passbank-plan 1
a sha256:f9e990d900a1a770892269f36fb16aded10d4f4412d1c98fae0853265e8d4348 personal.kdbx
b sha256:2b01d12712a753ad16858bce07c1531bec285d61c0ed3bd1eaa06aa218fe2491 laptop.kdbx
# only in A
keep abcd0000-0000-0000-0000-00000000000b # Email / Work mail
# only in B
keep abcd0000-0000-0000-0000-000000000006 # group: Games
keep abcd0000-0000-0000-0000-000000000010 # Games / Old forum
# differs: password, url (A 2026-10-01 03:00, B 2026-10-01 20:00)
take-b abcd0000-0000-0000-0000-00000000000c # Banking / My bank
# differs: title (A 2026-10-01 09:00, B 2026-10-01 04:00)
take-a abcd0000-0000-0000-0000-00000000000d # Shopping / Store
# deleted in A on 2026-10-01 12:00 (B 2026-10-01 06:00)
drop abcd0000-0000-0000-0000-00000000000f # Social / Old account
# deleted in B on 2026-10-01 02:00 (A 2026-10-01 08:00)
keep abcd0000-0000-0000-0000-00000000000e # Social / Stale login
# group differs: notes (A 2026-10-01 02:00, B 2026-10-01 06:00)
take-b abcd0000-0000-0000-0000-000000000004 # group: Shopping
# settings differ: name (A -, B -)
settings take-a
Two programs, one core
Both make the same database from the same inputs and the same choices. Use the window when you want to look at the changes, and the command line in a terminal or in a script.
passbank-gui
One window, three screens
Open the two files, review the changes, write the new database. The application keeps no state between runs, so there are no recent files and no settings. When you close the window or go back to the first screen, the unlocked databases and their secrets are dropped.
- The keys
A,B,K,DandNset the choice of every selected row - A filter for each kind of change and for the changes you did not decide yet, and a search over group path and title
- It works by keyboard alone and with a screen reader
- It is light or dark, as your desktop is
passbank-gui
Choose the version, the credentials and the encryption
The last screen asks where the new file goes, which KDBX version it gets, and whose database settings, credentials and encryption it takes. When the version you chose cannot store something that is in the result, a warning lists what would be lost, and Write asks you to confirm.
- KDBX 4 unless you pick another version
- The credentials of A, of B, or new ones
- Write runs in the background, with a progress bar and a Cancel button
passbank info
Look at a file before you merge it
passbank info prints the KDBX version of a file, its cipher, its key derivation with the parameters, its compression, and how many groups, entries, attachments and history items it holds. It asks for the password, because the counts are inside the encrypted part.
$ passbank info personal.kdbx
Password for personal.kdbx:
version 4.0
cipher AES-256
kdf AES-KDF
kdf-rounds 1000
compression GZip
inner-stream ChaCha20
groups 5
entries 5
attachments 0
history 0
passbank diff
See what differs, and decide in a file
passbank diff unlocks both files, counts the changes of each kind and writes the plan. The plan starts from the defaults, or from the rule you name with --prefer.
- Entries and groups that are only in A or only in B
- Entries in both that differ, and groups whose own properties differ
- Entries that one side deleted
- The settings of the two databases, when they differ
$ passbank diff personal.kdbx laptop.kdbx -o plan.txt
Password for personal.kdbx:
Password for laptop.kdbx:
A: personal.kdbx
B: laptop.kdbx
changes: 9
only-a 1
only-b 2
differs 2
deleted-in-a 1
deleted-in-b 1
group-differs 1
settings 1
plan written to plan.txt
passbank merge
Merge with the plan, or by a rule
With --plan or --prefer the merge asks no questions, so it fits in a script. newer takes the newer version of what differs, a and b let one side win everywhere, and union keeps everything that exists on one side only and both versions of every pair that differs.
--formatpicks the KDBX version, and the merge refuses to write what that version cannot hold, unless you pass--allow-loss--credentialsand--encryptionsay whose password, key file, cipher and key derivation the new file gets- A file that exists is replaced only with
--force
$ passbank merge personal.kdbx laptop.kdbx --plan plan.txt -o merged.kdbx
Password for personal.kdbx:
Password for laptop.kdbx:
A: personal.kdbx
B: laptop.kdbx
changes: 9
only-a 1 keep 1
only-b 2 keep 2
differs 2 take-a 1, take-b 1
deleted-in-a 1 drop 1
deleted-in-b 1 keep 1
group-differs 1 take-b 1
settings 1 take-a 1
result: 6 groups, 6 entries
written: merged.kdbx (KDBX 4.0)
# The same file again
$ passbank merge personal.kdbx laptop.kdbx --prefer union -o merged.kdbx
passbank merge: merged.kdbx exists; use --force to replace it
passbank merge
Or decide one change at a time
With neither --plan nor --prefer, Passbank goes through the changes on the terminal. For each one it shows the group path, the title, both modification times and the fields that differ, and asks for a choice with one key. At the end it shows a summary and asks before it writes.
- Enter takes the default that the prompt shows
vshows the protected values that differ, once, for this change onlypgoes back,rapplies a rule to the rest,qquits and writes nothing
# The fourth and the fifth of nine changes
$ passbank merge personal.kdbx laptop.kdbx -o merged.kdbx
[4/9] differs Banking / My bank
A modified 2026-10-01 03:00, B modified 2026-10-01 20:00
differs: password, url
url A: https://bank.example.com B: https://bank.example.org
[a] take A [b] take B [t] keep both [d] drop Enter = take B
choice> t
[5/9] differs Shopping / Store
A modified 2026-10-01 09:00, B modified 2026-10-01 04:00
differs: title
title A: Store B: Store (old name)
[a] take A [b] take B [t] keep both [d] drop Enter = take A
choice> b
What gets merged
Passbank keeps everything an input holds and you keep. The exact rules are in the specification of the repository.
Matched by UUID
Entries and groups are paired by their UUID, never by their title. Passbank does not guess that two entries with the same title are the same account.
Keep both
For a pair that differs you take A’s, take B’s, or keep both. B’s copy then gets a new UUID.
History
The histories of the two versions of an entry are united.
Everything else
Attachments, custom icons, custom data, auto-type settings, and XML elements that Passbank does not know.
Deleted entries
An entry that one side deleted is dropped or kept, as you decide. By default the deletion wins when it is newer than the entry.
Database settings
The name, the description, the history limits, the recycle bin and the rest come from A or from B, as you choose.
Passwords are asked, not passed
A password is never taken as an argument or from the environment, because other processes can read both. Passbank asks on the terminal without echo, or reads a file that only you can read.
Files are not trusted
Every length and count read from a file is bounded before memory is allocated, and the parsers are fuzzed.
What it reads and writes
Passbank reads every one of these, in any combination, and writes every one of the versions.
| What | Supported |
|---|---|
| KDBX versions | 2.x, 3.0, 3.1, 4.0 and 4.1 |
| Ciphers | AES-256, Twofish and ChaCha20 |
| Key derivation | The AES-KDF, Argon2d and Argon2id |
| Credentials | A password, a key file (XML 1.0 and 2.0, raw 32 bytes, hex, or any file), or both |
| Compression | GZip or none |
| The files it writes | Open in KeePassXC 2.7.12, tested with keepassxc-cli for every combination of cipher, key derivation and compression |
Reading was checked against files from KeePassXC, KeePass, pykeepass, kdbxweb, gokeepasslib and keepass-rs. KDBX 2.x and 3.0 files from other programs were not available to test. They are read by the same code as 3.1.
Built on Glutter
The window of passbank-gui is drawn by my own GUI toolkit, without cgo.
What Passbank is not
Better to read it here than to find it out.
- It is not a password manager. It does not view, edit or create entries outside a merge. Use KeePassXC or another KeePass client for that. The databases Passbank writes open in them.
- It does not merge more than two databases in one run. Run it twice.
- A choice is for a whole entry. You cannot take one field from A and another from B.
- It does not read KeePass 1 (
.kdb) files, and it does not support hardware keys (YubiKey) or Windows account keys. - It does not promise that a secret never reaches swap or a core dump. Go’s runtime can copy memory, and the operating system can write it to disk. If that matters to you, use encrypted swap and disable core dumps.
- It runs on Linux only.
Under the hood#
The two files, A and B, can be of any KDBX version from 2.x to 4.1, and need not be of the same one. Passbank lists what differs: entries only in A, entries only in B, entries in both that differ, and entries that one side deleted. The new file is KDBX 4 unless you pick another version.
There are two programs on one shared core, so both make the same database from the same inputs and choices: passbank, a command-line tool for terminals and scripts, and passbank-gui, a desktop application built on Glutter. Neither needs a C compiler to build.
The new file is first written to a temporary file in the folder of the target, readable only by you. It is synced, read back and compared, and only then put in place.
Secrets in memory (passwords, keys and the protected values of fields) are held as bytes and overwritten when they are no longer needed, as far as Go allows. They are never written to a log, an error message or a plan file. An error shows paths, UUIDs and versions, never a secret value.
The command line exits with 0 on success, 1 on failure and 2 for a mistake in the arguments, and --debug shows the route of an error.
- Kind
- Application
- Language
- Go
- Runs on
- Linux
- License
- MIT
- Version
- v1.0.7
Install one program, or both
Passbank needs Go 1.27 or later and no C compiler. The desktop application needs a Wayland or X11 desktop with Vulkan or OpenGL ES 3.0 drivers.
# The command line
$ go install github.com/rm4n0s/passbank/cmd/passbank@latest
# The desktop application
$ go install github.com/rm4n0s/passbank/cmd/passbank-gui@latest
# See what differs between two databases
$ passbank diff personal.kdbx laptop.kdbx -o plan.txt
# Or open the window
$ passbank-gui

