This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to backup akonadi database?

Tags: None
(comma "," separated)
anonymousleopard
Karma
0

How to backup akonadi database?

Tue Dec 01, 2015 1:05 am
I am currently setting up a tape backup.

Looking at the user's home directory I see there are lots of files in ~/.local/share/akonadi/db_data/. Considering that it is a live database I suppose it would be very incorrect to simply copy the files and I should rather make a database dump. On the other hand being logged in as root in mysql and running 'show databases;' does not show a database for akonadi at all which means I can't even find a way to dump the database to an .sql file.

So what is the proper way to do this?
User avatar
einar
Administrator
Posts
3402
Karma
7
OS

Re: How to backup akonadi database?

Wed Dec 02, 2015 7:57 pm
You need to use the my.cnf that's in ~./local/share/akonadi and connect to the socket Akonadi uses. Unless configured differently, Akonadi runs its own instance of mysql / mariadb, running as the user in the session.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
anonymousleopard
Karma
0

Re: How to backup akonadi database?

Wed Dec 02, 2015 10:02 pm
Thanks. In the meantime I learned how to make Akonadi use the central mariadb mysql db. So now I can dump it as a regular db.

After doing that: which files/dirs in ~/.local/share/akonadi are safe to remove?
User avatar
einar
Administrator
Posts
3402
Karma
7
OS

Re: How to backup akonadi database?

Fri Dec 04, 2015 6:48 am
lost+found there can be ignored. The rest is pretty much essential IMO.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
dtonhofer
Registered Member
Posts
7
Karma
0

Re: How to backup akonadi database?

Tue Jan 05, 2016 11:34 am
Sorry to barge in on this.

Is there are ready-made process to freeze & flush the akonadi databases of all the users at backup time and keep them frozen till backup has been performed?

To keep interruption to a minimum, one would probably want to freeze & flush all user database, snapshot the home partition at LVM level, unfreeze the databases and then proceed with backing up the snapshot, file per file (no database dumps involved as the database backing files would be consistent). I suppose someone must have done that already? Possibly via systemd black magic.

I have also noticed that akonadiserver/mysql process may merrily chug along even if the owning user in question has logged off, which may be a problem,?

Best regards,

-- David
User avatar
progdan
KDE Developer
Posts
90
Karma
0
OS

Re: How to backup akonadi database?

Sat Jan 09, 2016 10:33 am
I can't help with the backup, I'm not really sure if there is even a way to do it like this, at least there is no mechanism to inhibit Akonadi so that you can snapshot both the database and ~/.local/share/akonadi.

To be honest I doubt the need for actually backing up Akonadi data dir. Those are just locally cached data from remote (or other local) sources, so in case of failure users won't actually lose any data as they are permanently stored elsewhere (IMAP server, CalDAV server, local maildir, ...). There will be the extra annoyance of setting up all resources and synchronizing all the data again, but that might in the end turn out to be less hassle than implementing a proper backup strategy for Akonadi :-)


Daniel Vrátil | www.dvratil.cz | dvratil@kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)
anonymousleopard
Karma
0

Re: How to backup akonadi database?

Sat Jan 09, 2016 10:38 am
I have set it up to use external mysql DB and I dump and backup all mysql DB's to files before running backup. That's the best setup imho.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]