gromox-kdb2mt — Utility for analysis of Kopano databases


gromox-kdb2mt [-pstv] [–src-host sqlhost] [–src-user sqluser] [–src-port sqlport] –src-at dir {–src-guid mboxguid|–src-mbox username} […]


gromox-kdb2mt reads one store from a Zarafa/Kopano SQL database and, for attachments, the associated filesystem. The data is then re-exported in a Gromox-specific mailbox transfer format to stdout for consumption by pipe by the gromox-mt2exm(8gx) program. Optionally, kdb2mt can print a summary of the hierarchy during extraction.

The SQL server that carries the Zarafa/Kopano database for the home server of the user must be active. Databases with a schema version n61 or newer (ZCP 7.0.3 and onwards, all KC) are supported.

The kopano-server(8) process need not be running.

The directory of Kopano attachments of the home server should be made available in the mount namespace whereever gromox-kdb2mt runs.



Show properties in detail (enhances -t).


Splice objects from the source database into existing (Gromox-side) folders. Specifically, the source mailbox root is mapped to the Gromox store root, and special folders (Sent Items, Deleted Items, etc.) are mapped to special folders in the target store.


Show a diagnostic tree view of the source data as it is being read.


Print message count progress while processing larger folders. This option has no effect if (the even more verbose) -t option was used.

–src-host hostname
Hostname for the source SQL connection.
Default: (MySQL default; localhost)
–src-port port
Port for the source SQL connection.
Default: (MySQL default; automatic)
–src-user username
Username for the source SQL connection.
Default: root
–src-at directory

Required specification to the /var/lib/kopano/attachments directory mounted somewhere locally. (To skip over file-based attachments, use the empty value, i.e. –src-at “”.)

–src-guid guid

Extract the mailbox with the particular GUID from the source. (May be used to read orphaned stores.)

–src-mbox username

Extract the mailbox of the given username from the source.

–l1 x, –l2 y

If you are using “attachment_storage=files_v1-x-y” in kopano-server.cfg, call kdb2mt with the L1 and L2 options.

–only-obj hid

Extract just the object with the given hierarchy id. This option may be specified multiple times. In the output stream, the objects will have an unspecified location given as their parent folder. (mt2exm will use the drafts folder because it is expectedly less crowded than one’s inbox.)

Environment variables


Password for the source SQL connection.


Scenario 1. Gromox and Kopano are located on two different hosts; gromox-kdb2mt is executed from the Gromox system and pulls from a remote SQL and remote filesystem presented locally.

sshfs root@kdb.lan:/var/lib/kopano/attachments /tmp/at

SRCPASS=rootpass gromox-kdb2mt –src-sql kdb.lan –src-attach /tmp/at –src-mbox jdoe –dst-mbox john.doe@gromox.lan | gromox-mt2exm

Scenario 2. Gromox can be installed on the Kopano host, pulling from a local/remote SQL and local filesystem, while sending its export stream to another machine.

gromox-kdb2mt –src-attach /var/lib/kopano/attachments –src-mbox jdoe | ssh -Tenone root@gromox.lan “gromox-mt2exm -u

It is also possible to copy the attachment directory beforehand, or to store the MT data stream, though additional disk space for these intermediate objects and representation would be required.

See also

gromox(7), gromox-mt2exm(8gx)