Skip to content

Add Akonadi DB Migrator tool

Daniel Vrátil requested to merge work/dvratil/t6862-db-migrator into master

This change add akonadi-db-migrator tool which allows to seamlessly migrate Akonadi database between supported database engines. It preserves IDs, so after the migration, all application configuration that refer to Item IDs or Collection IDs remains valid. The process itself is simple: it creates a the new database in a separate directory, copies all data from the old database to the new one, then move the old database to a backup location and the new database into the main location. Finally, akonadiserverrc is updated to reflect the new DB engine configuration.

The migrator uses the high-level database abstractions that we have in Akonadi so that changes to DB schema do not require any modifications to the tool. This required a modification to the generated Entity-derived types to be able to use an arbitrary DataStore, which is a general step to move away from the DataStore singleton. Similarly for DbConfig, DbInitializer and DbIntrospector, which can all now be constructed individually and with custom configuration.

The tool itself is a CLI tool that is passed the new DB engine as an argument and it outputs progress to stdout/stderr. However, the DbMigrator class itself is designed in a way that allows a widgets/Kirigami UI for less advanced users to be created.

Merge request reports

Loading