Migrate akonadi to sqlite from postgres

Hi,

I read that Akonadi defaults to sqlite now, but I have a really old (as in installed a long time ago, not old versions) installation using postgres as database, and really don’t want to set up everything again. Any tips on how to migrate so sqlite?

Maintaining postgres is fun, but…

1 Like

Hi,

sqlite is not the default yet, but we are heading in that direction. Currently there’s no simple or straightforward migration from postgres or mysql to sqlite. I’m contemplating adding a one-directional migration option to akonadictl (your are not the first one to ask about migrating to sqlite), but did not have time yet to look at it.

Basically, your only option is to manually dump the postgres database and import it into sqlite - which is not as straightforward as it sounds as one needs to manually tweak the schema queries due to differences in value types supported by each.

Once you have the sqlite database ready, just move it to ~/.local/share/akonadi/akonadi.db and modify ~/.config/akonadi/akonadiserverrc to say:

[%General]
Driver=QSQLITE

[QSQLITE]
Name=/home/<you>/.local/share/akonadi/akonadi.db

What might actually be easier would be to create an SQLite-based Akonadi database in a second user account (which will initialize the schema for you) and then you just import into it the data dumped from postgres - that might work without any need to change anything.

1 Like

In Plasma 6.0 there is now a tool called akonadi-db-migrator. It allows you to migrate between various Akonadi back ends. I have not tried it yet, but it might be worth trying.

1 Like

Seems the migrator will be available in 24.05

Thank you @dvratil !

1 Like