Scroll to navigation

kopano-dbadm(8) Kopano Groupware Core reference kopano-dbadm(8)

Name

kopano-dbadm — database administration utility

Synopsis

kopano-dbadm [-c server.cfg] action...

Description

This tool is for special surgical tasks on the Kopano SQL database. kopano-server ought to be stopped when running this utility, unless otherwise noted. You should make a database backup first.

Options

-c server.cfg
By default, kopano-dbadm will read /etc/kopano/server.cfg for MySQL connection parameters, but an alternate file may be specified.

Actions

k-1216

This is an alias for the combination of: index-tags, np-remove-highid, np-remove-unused, np-repair-dups, np-defrag, rm-helper-index. It may be used to address the K-1216 issue that kopano-server(8) may report when performing a schema update. If the tag indices already exist, harmless warnings will show, but the indices will be used and left as-is after the k-1216 action is done.

kc-1375

Deletes all cached IMAP Envelopes that show signs of having address lists with excess parentheses. This action can be executed while kopano-server is active. If you do so, also execute `kopano-srvadm --clear-cache=cell` afterwards.

np-defrag

Compact the ID space in the namedproperties table and lowers the AUTO_INCREMENT value, thereby making IDs actually usable after a remove operation (such as np-remove-xh).

np-remove-highid

Remove all named property mappings with internal ID higher than 31485. As Kopano/Zarafa MAPI clients cannot handle these IDs anyway, the IDs are never used to store any data and only occupy the ID space needlessy.

np-remove-unused

Remove all named property mappings that have zero use counts in other tables.

np-remove-xh

kopano-dagent(8) used to index all X-Headers from Internet e-mails by default, but administrators may not have needed this information in the first place. By using np-remove-xh, all named properties whose name starts with "X-" and have GUID=PS_INTERNET_HEADERS are removed. np-defrag should be run afterwards.

np-repair-dups

Repairs duplicate named properties (only IDs below or equal to 31485).

np-stat

Show statistics for the namedproperties table. This action can be executed while kopano-server is active.

index-tags

Create helper indices for the "tag" columns. This action can be executed while kopano-server is active.

rm-helper-index

Remove helper indices again. This action can be executed while kopano-server is active.

usmp

This is an alias for the combination of: usmp-shrink-columns, usmp-charset.

usmp-charset

Convert the database to utf8mb4 to support the Unicode Supplemental Plane, better known for Emoji characters.

usmp-shrink-columns

A number of table columns will be shrunk to accommodate certain MySQL index limits.

Performance

Totally depends on the amount of data that needs to be moved. MySQL also seems to process the requests single-threadedly.

An approximate row count of a table can be retrieved with SHOW TABLE STATUS LIKE "properties". For an exact count, use SELECT COUNT(*) FROM `properties`.

k-1216

An i7-3930K completed a naturally-evolved DB (4.96 GiB, properties: 12.94M rows, tproperties: 9.65M rows, mvproperties: 9.9K rows, indexedproperties: 3.24M rows, singleinstances: 188K rows, names: 2988) using the "k-1216" command combo within 2 minutes and The "np-remove-xh, np-defrag" combo within 5 1/2 minutes.

usmp-charset

An AMD Ryzen 1700X completed the "usmp-charset" transformation on a DB (6.3 GiB, properties: 16.43M rows, tproperties: 12.25M rows, mvproperties: 10.2K rows, indexedproperties: 410K rows, singleinstances: 258K rows) in 7 minutes.

See also

kopano-server.cfg(5)
2018-04-11 Kopano 8