Akonadi: Difference between revisions

From KDE UserBase Wiki
(Marked this version for translation)
 
(73 intermediate revisions by 22 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Akonadi}}
<languages />
<translate>


==Introduction==
==Introduction== <!--T:1-->
This page is mainly concerned with troubleshooting Akonadi, as there are inevitable glitches in early stages of migration.  For many people the first signs of Akonadi activity will be in KDE SC 4.4, and many will be confused by it.  For a brief description of the purpose of Akonadi, see [[Glossary#Akonadi|this Glossary entry]].  You will also find useful links to further reading.  Once the inevitable teething troubles are over Akonadi will provide a power-house usable by many applications.


===Understanding the Structure===
<!--T:2-->
You can, of course, simply use Kontact to manage all your addressbook, but if you have a backup system in place, for instance, you'll want to know where your data is, and how it's handled. The page [[Akonadi_and_AddressBook]] will help.
The '''Akonadi''' framework is responsible for providing applications with a centralized database to store, index and retrieve the user's personal information. This includes the user's emails, contacts, calendars, events, journals, alarms, notes, etc.


== Troubleshooting Tips ==
<!--T:62-->
* When reporting problems with the Akonadi server, always include the comprehensive self-test report. This report can be obtained from the self-test dialog which shows up whenever the Akonadi server was unable to start successfully. You can find the selftest dialog in the kcmmodule that is accessable via 'kcmshell4 kcm_akonadi'.
Currently, all [https://kontact.kde.org/ KDE PIM applications] with the exception of [[Special:myLanguage/Akregator|Akregator]] are using '''Akonadi''' to access user's PIM data.


* Starting the Akonadi server manually on the command line can result in additional useful information. This can be done by running '''akonadictl start''' on a console. Similar, with '''akonadictl stop''' the Akonadi server can be stopped again.  '''akonadictl status''' gives more useful information.
==Controlling Akonadi== <!--T:15-->


==Common Problems==
<!--T:63-->
'''Akonadi''' will start automatically in the background when any application using it is started.


===Kontact doesn't start - and doesn't tell me anything===
<!--T:64-->
If Kontact doesn't start, and you see no error messages, check that Akonadi is running. Akonadi should start on demand, but currently (January 2010) it doesn't.  You have to start it before Kontact will start up if you have any migrated resources (most likely KAddressBook).  Use the AkonadiTray icon to start it.
To manually start, stop or restart '''Akonadi''', you can use the <code>akonadictl</code> command from the commandline.
Using this method, you can get additional useful information on the console.


===Kontact doesn't start - version II===
<!--T:17-->
Kontact has been known to be hit after an update.  If this happens, try starting KMail, KOrganizer or any of the other applications from KRunner (or Konsole).  Chances are high that they will work as stand-alone apps while you find what went wrong.
To start the '''Akonadi''' server,


===Folder not found: "/Local"===
<!--T:18-->
Many people have reported this error, when Kontact would not start.  There seems to be a bug in the migration that is telling KMail to look for local mail in /home/anne/.local/share/Local, a directory that had not been set up.  The cure for this is not to attempt to correct it, but, with KMail/Kontact closed, to open the Akonadi Console (user krunner, Alt-F2, or 'akonadiconsole' in konsole), and remove the resource that it says is for local mail.  You should now find that you can start Kontact or KMail, and that a new resource will be created, pointing to /home/anne/.local/share/local-mail
{{Input|1=akonadictl start}}


===There are other new folders under ~/.local/share/===
<!--T:19-->
Yes.  If your addressbook has migrated correctly a new resource will have been created as ~/.local/share/contacts/
To stop the '''Akonadi''' server,


===What are /usr/bin/akonadi_maildir_resource and /usr/bin/akonadi_maildispatcher_agent?===
<!--T:20-->
{{Input|1=akonadictl stop}}


The akonadi_maildir_resource is created automatically by the akonadi_maildispatcher_agent, while the latter is always started together with the Akonadi server as it provides basic functionality (e.g. sending mail) that is used by all mail applications that are (and will be) based on Akonadi. So it is ok that these two are running, as a user you can simply ignore them.
<!--T:21-->
This autogenerated akonadi_maildir_resource will always point to ~/.local/share/local-mail/ which is your 'Local folders' account where your local folders and emails will be stored.
To restart a running '''Akonadi''' server,


At this point, in KDE SC 4.4, mail is not yet being migrated.
<!--T:22-->
{{Input|1=akonadictl restart}}


===Nepomuk Indexing Agents have been Disabled===
<!--T:23-->
Kontact is now working, but you keep seeing this notice:
To query the status of the '''Akonadi''' server,


[[image:NepomukError.png|418px|center]]
<!--T:24-->
{{Input|1=akonadictl status}}


The most common reason for this notice is that Nepomuk is simply disabled in System Settings. Please try enabling it in System Settings under Advanced / Desktop Search / Basic Settings by checking "Nepomuk Semantik Desktop" and clicking Apply.
===Disabling the Akonadi subsystem=== <!--T:56-->


If this does not help (or if the option was already checked when you got the error) and if you have previously been using prereleases of KDE SC 4.4, you may be affected by a change to the database layout (due to an upgrade of the Virtuoso database server from version 5 to version 6; production releases of KDE SC 4.4 are expected to be shipped with Virtuoso version 6). The following commands should get it working again:
<!--T:57-->
{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
The '''Akonadi''' server is automatically started by any '''Akonadi'''-enabled application. If you don't want Akonadi to be started after login, you have to ensure that no '''Akonadi'''-enabled application is launched at login or thereafter. Remember to check '''Plasma''' applets as well — the '''Digital Clock''' widget in the default panel, for instance uses '''Akonadi''' to (optionally) display calendar events and this is enabled in its settings by default (see the "Display Events" option) . You must remove any widgets that may start it from your start-up, if you wish Akonadi to start only when you start '''KMail''' or other applications.
| qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
|-
| rm -r ~/.kde/share/apps/nepomuk
|-
| rm -r ~/.kde4/share/apps/nepomuk
|-
| nepomukserver
|}
Note that the above commands will '''not''' enable Nepomuk permanently if it isn't already enabled, you have to use System Settings for that.


A running Nepomuk is necessary to have a working Akonadi, and thus a working Kontact.
<!--T:26-->
However, you can disable the Strigi file indexer, it is not needed for Kontact. Strigi file indexing is used for desktop searching only, which is unrelated to Kontact. Just make sure Nepomuk itself is running correctly for Kontact.
{{Remember|1=If you don't want to have '''Akonadi''' running on your system at all, you can not use any of the '''Akonadi'''-enabled applications, such as KMail, KOrganizer or KAddressbook. Such applications will not work when '''Akonadi''' is disabled using the steps below. Also note, that some '''Plasma''' widgets, such as the '''Digital Clock''' uses '''Akonadi'''.}}


In Kontact, Nepomuk is used for many different things, ranging from displaying upcoming birthdays, over handling free/busy lists to showing a contact photo in the message viewer. If Nepomuk is not running, several different things in Kontact will cease to work. The notice is there to warn you about the reduced functionality. Enabling Nepomuk as described above fixes the problem.
<!--T:58-->
To ensure that '''Akonadi''' is not started, check that no applications require it at login. In particular, open the Plasma clock applet preferences, go to <menuchoice>Calendar</menuchoice> and uncheck <menuchoice>Show events</menuchoice> to prevent Plasma from requesting information from '''Akonadi''' and thus allowing it to start.


You can check if Nepomuk is correctly running by typing ''akonadictl status''.
==Some Definitions== <!--T:65-->


===I want to use my current Address Book and Organizer - Can I?===
<!--T:66-->
Yes. When you use the Akonadi Console to add a resource it allows you to choose as Standard Addressbook - point that to your std.vcf should work fine. Migration does not destroy your old addressbook. You can continue to use it, though you will lose any benefits that Akonadi can bring.  Alternatively you can have both an Akonadi addressbook and your original one, for a time, if you feel safer that way.
;Real data
:By ''real data'' we mean the data, like the contacts or events. These data are stored either on a groupware server or in local files. Where exactly depends on the resource you are using. E.g. the ''Personal Contacts'' resource stores its data under ''$XDG_DATA_HOME/contacts''.


===I can't see any details in my Address Book===
<!--T:67-->
At the moment, the cause of this is not identified, but the cure is simple.  Close Kontact, and start KAddressBook as a stand-alone application. After you close it you will be able to use it within Kontact.  It seems that something is not being triggered when Kontact launches, and I expect this to be identified and fixed soon.
;Cached data
:The ''cached data'' are copies of the real data that are kept in the database for faster access and offline caching. The database also keeps the ''meta data'' which are management data needed by '''Akonadi''' to work correctly.


===My contacts don't show when I use the Select button in KMail===
<!--T:68-->
Check System Settings > Advanced tab > KDE Resources.  Make sure that your Akonadi controlled address book(s) are listed there - add them if necessary. At the same time, it's a good idea to make your main Akonadi addressbook, usually called Personal Contacts, is set to be the default.
;Configuration data
:The ''configuration data'' are the data that configure the '''Akonadi''' server and the individual resources. The general configuration data for the server can be found under ''$XDG_CONFIG_HOME/akonadi''. The configuration data for each indvidual resources are stored under ''$XDG_CONFIG_HOME/akonadi_xyz_resourcerc#'' ('''''xyz''''' is name of resource and '''''#''''' its instance number).


===How do I get my Groupware addressbook back?===
<!--T:69-->
Two solutions: using the old framework or the new one.
:The '''Akonadi''' server configuration is a couple of files in ''$XDG_CONFIG_HOME/akonadi''. It contains which data sources and helper programs are active and will be started and watched (so they can be restarted on crashes) by one of '''Akonadi's''' server processes '''(akonadi_control)'''.


Old framework: In akonadiconsole, add a "KDE Address Book (traditional)". The KDE Address Book means you can set up old kresources for AkonadiIn the configuration of "KDE Address Book (traditional)", you point it to an "IMAP over KMail" KResource and in KMail, the groupware options should be enabled.  This should work for Kolab, eGroupware and similar addressbooks - you will need to check the options to make sure that the correct type is selected.
<!--T:70-->
:Each data source handler (called resources) or helper program (called agents) can have its own configuration although some agents or resources don't require configuration. The general rule is that for every entry in ''$XDG_CONFIG_HOME/akonadi/agentsrc'' there is a corresponding configuration file in ''$XDG_CONFIG_HOME''For example, if the ''[Instances]'' section in ''agentrc'' contains an entry for ''akonadi_ical_resource_2'', there is also a config file called ''akonadi_ical_resource_2rc'' in the ''$XDG_CONFIG_HOME directory''.


New framework (only tested with kolab): In the akonadi configuration module (run 'kcmshell4 kcm_akonadi' to see it), add an "IMAP E-Mail Server" resource, and set up your mail server name, username and password, then click Auto-Detect. Then add a kolab resource. The next step is to wait for the imap resource to synchronize, this can take quite a long time. The status will appear in the akonadi configuration module. If nothing happens, try restarting akonadiserver. After some time the kolab addressbook(s) should appear in kaddressbook.
<!--T:71-->
:Depending on the type of data, such config files for resources will have filenames or directory names of where the data is stored. Common locations are KDE's legacy default files, e.g. ''$HOME/.kde/share/apps/korganizer/std.ics''. New default locations are files and directories in ''$XDG_DATA_HOME'', e.g. ''$XDG_DATA_HOME/contacts''.


===You experience long delays when sending mail===
==Backup== <!--T:72-->
This is accompanied by KMail freezing until the mail is actually dispatched.


A bug has been found in the way Nepomuk checks addresses, which can cause huge delays.  This is fixed for SC 4.4.1. Until that is with us, there is this work-around:
<!--T:73-->
So now we need to decide what to back up.  If you want to backup the "real data", then it depends on the resources you have configured... if you use a groupware server, then the backup should be done there. For contacts, the files under ''$XDG_DATA_HOME/contacts'' will normally be what you need.


Close Kontact or KMail and KAddressbook if you are running
<!--T:74-->
stand-alone apps. Disable Strigi in SystemSettings.  Stop Nepomuk, delete the  
To back up the entire ''Akonadi'' configuration, including which resources are active and their configuration, you can use the '''pimdataexporter''' tool. This, however doesn't back up the Akonadi database containing the cached data and, unfortunately, after restoring the configuration (using the '''pimdataexporter'' again), Akonadi will have to re-fetch all data again into its cache. This can cause configuration that points to actual mail folders or calendars to get broken and accidentally point to another folder.
database and restart ''nepomukserver''. The actual commands you need are (as
user)


{|style="width:98%; border:2px dotted #BCBCBC; background:#EEEEEE;"
<!--T:75-->
|qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
'''After restoring configuration and syncing all data, it's vital to manually check all folder configuration, especially in KMail identities and make sure the folders are configured properly.'''
|-
|rm -r ~/.kde/share/apps/nepomuk
|-
|rm -r ~/.kde4/share/apps/nepomuk
|-
|nepomukserver
|}


This will, of course, wipe out all the database, including any tags you've
==Frequently Asked Questions== <!--T:34-->
added.  In theory, I understand that it's possible to do a more selective wipe
of the database.  If this matters to you you can find the instructions at
http://techbase.kde.org/Development/Tutorials/Metadata/Nepomuk/TipsAndTricks#Remove_all_Strigi-indexed_data


== Some Technical Issues ==
=== Where is my data now? === <!--T:45-->
=== Nepomuk ===
Starting with KDE 4.4, it is required that Nepomuk is running in order for Akonadi to work correctly. Akonadi will check this and display an error dialog on startup if this is not the case.


Nepomuk only works with the Virtuoso backend.
<!--T:76-->
You can check whether the Nepomuk is running with the correct backend by using the Akonadi self-test dialog, as described above.
Your data are safely stored outside of '''Akonadi''' control on your disk (e.g. local maildir folder or iCal calendar), or on a remote server (in case of e.g. email over IMAP or events from a CalDAV calendar). '''Akonadi''' will optionally store a copy of this data in its database to allow applications to quickly retrieve and display them. Any modifications done to data in the '''Akonadi''' database will be synced to the actual storage. The main advantage of using the database as a cache is that remote PIM data are available even when you are offline, and you can still interact with them (e.g. mark emails as read or move them, create new events, reschedule existing meetings etc.) and all the changes will get synced automatically once you connect to the internet again.


Although Nepomuk is required to be running, you can still disable Strigi file indexing, which is usually the most resource-intensive part of the Nepomuk framework.
<!--T:77-->
Thus, deleting the '''Akonadi''' database will not cause any data to be lost (as long as all pending changes are synced).


=== Apparmor ===
=== How to upgrade my PostgreSQL database? === <!--T:60-->
Some distributions using Apparmor have it set up in a way that prevents Akonadi from running its internal database server. This can result in a variety of fuzzy error messages, including but not limited to the following:
* unknown error 255 when running akonadictl
* "DB error: 'Could not open required defaults file: /home/$username/.local/share/akonadi/mysql.conf"


You can solve this by running '''aa-complain mysqld''' with root privileges then reload apparmor.  
<!--T:61-->
On KUbuntu this is:  
After updating your PostgreSQL server to a new major version, sometimes you will have to convert your Akonadi database for use with this new version. Instructions can be found on [[Special:myLanguage/Akonadi/Postgres_update|this page]].
sudo aa-complain mysqld
sudo /etc/init.d/apparmor reload


Note that you might be using Apparmor even if it does not show up in the process list.
=== Migration problems === <!--T:47-->


Also note that some distributions ship an additional ''mysqld'' binary called ''mysqld-akonadi'' which has AppArmor set up correctly. If that's the case on your system and you see this problem nevertheless, there are two possible reasons:
<!--T:35-->
* Akonadi still uses ''mysqld'' instead of ''mysqld-akonadi''. You can change that in Systemsettings -> Advanced -> Akonadi -> Server configuration.
'''Akonadi's''' [[Special:myLanguage/Glossary#Akonadi|Glossary entry]] has a brief description of Akonadi's purpose, and other useful links.
* AppArmor is not setup correctly for ''mysqld-akonadi'' either. Try running the ''aa-complain'' command noted above with ''mysqld-akonadi'' instead of ''mysqld''.


---
=== How do I switch from MySQL/PostgreSQL to SQLite? === <!--T:78-->


You will also experience this problem if you are running an encrypted home directory using encryptfs combined with AppArmor as the Akonadi apparmor profile currently does not account for an ecrypted home (common with Ubuntu Jaunty users).  Error messages with include:
<!--T:89-->
* dmesg produces:  
Since Akonadi 6 [https://invent.kde.org/pim/akonadi/-/merge_requests/154 akonadi-db-migrator] is included in akonadi that allows you to switch the database backend. Where for previous versions this involved deleting and recreating the database a migration is now properly supported by akonadi.
      ecryptfs_do_create: Failure to create dentry in lower fs; rc = [-13]
      ecryptfs_create: Failed to create file inlower filesystem
* Akonadi will list the following errors:
      Akonadi server process not registered at D-Bus


The fix is to edit the following file "/etc/apparmor.d/usr.sbin.mysqld-akonadi".
<!--T:90-->
Below the line:  
The tool needs to be called with the parameter --newengine to chose to which backend it should to:
      @{HOME}/.local/share/akonadi/** rwk,
{{{
Add a new line:
  --newengine <ENGINE>      The new DB engine to use. Possible values are
      @{HOME}/.Private/** rwk,
                            "sqlite", "mysql" and "postgres"
}}}


Restart apparmor and restart akonadi.
<!--T:91-->
 
For example:
 
{{{
=== Missing Prerequisite ===
akonadi-db-migrator --newengine sqlite
To use Akonadi you need to have the following packages installed (names might differ depending on your distribution):
}}}
 
* The MySQL server (called ''mysql'' on OpenSuse)
* The Qt4 MySQL plugin (called ''libqt4-sql-mysql'' on OpenSuse)
 
If you compile Qt4 yourself, make sure to tell the ''configure'' script to build in MySQL support by passing it the '-plugin-sql-mysql' option.  If ''configure'' cannot locate the necessary MySQL client code (i.e, says "MySQL support cannot be enabled due to functionality tests") then ensure that the corresponding package is installed (typically called ''[lib]mysql[client]-dev[el]''). Also, depending on the install location of the MySQL headers, additional parameters to ''configure'' might be needed (eg. ''-I /usr/include/mysql'' on OpenSuse).
 
If you get the Qt4 direct from Nokia, such as a download of
  qt-sdk-linux-x86_64-opensource-2009.05.bin
 
you will ( by the command "akonadictl start") get an error at Test 1:
  ''Database driver not found.''
  ''Details: The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.''
  ''The following drivers are installed: QSQLITE.''
  ''Make sure the required driver is installed.''
 
The driver you need is ''libqsqlmysql.so''
 
Unfortunately this driver is not part of the distribution (until january 2010).
You need to compile the source. Download it
  qt-everywhere-opensource-src-4.6.0.tar.bz
 
''configure'' and ''make'' as above. But the ''make install'' doesn't copy the driver. So you have to copy it by yourself:
  ''cp <qt-src-dir>/qt-everywhere-opensource-src-4.6.0/plugins/sqldrivers/libqsqlmysql.so /usr/local/bin/sqldrivers/ ''
 
'''But''' the Revision '''4.6.1''', such as qt-sdk-linux-x86_64-opensource-2010.xx.bin
has the driver you needed.
=== Environment Setup ===
The Akonadi server searches for Akonadi agents and resources in the paths defined in the '''XDG_DATA_DIRS''' environment variable. If Akonadi complains about not finding agents or resources, check if this variable is set correctly. Also keep in mind that even if set in a current console session, it might not have been set when starting the server. Starting the server manually in the current console session excludes this cause.
 
=== mysqld: unknown variable 'innodb_file_per_table=1' ===
 
If the MySQL server log contains the following error:
<code>
[ERROR] /usr/libexec/mysqld: unknown variable 'innodb_file_per_table=1'
[ERROR] Aborting</code>
 
then your MySQL server was built without the InnoDB support which is required by Akonadi.
 
 
===Table 'mysql. servers' doesn't exist===
If MySQL server log contains the following error:
<code>[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
[ERROR] Cannot open mysql.db
[ERROR] Cannot open mysql.user
[ERROR] Cannot open mysql.event</code>
then, most probably, you don't have your MySQL configuration file in place. Copy it from ''/usr/share/config/akonadi/mysql-global.conf'' into ''~/.config/akonadi/mysql-local.conf''. (For debian and openSuSE users the file ist located in ''/etc/akonadi/mysql-global.conf''). Then open it and uncomment the line '''sql_mode=strict_trans_tables'''. If, after that, you get the following errors:
<code>[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE
failed.
[ERROR] Unknown/unsupported table type: innodb
[ERROR] Aborting</code>
then in the same file find the line that starts just like the one above (which you have uncommented), but has additional parameters, separated by commas (something like '''sql_mode=strict_trans_tables,strict_all_tables, ...etc'''). Comment the shorter ''sql_mode=...'' line and uncomment the longer one.
 
On openSUSE 11.2 running the command
<code>mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/</code>
will fix this problem.
 
=== Can't initialize character set latin1 ===
If you get the following error when starting Akonadi:
 
<code>Character set 'latin1' is not a compiled character set and is not specified in
the '/usr/share/mysql/charsets/Index.xml' file
Nepomuk QueryServer interface not available!
Connecting to deprecated signal
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
DataStore::unhideAllPimItems()
Character set 'latin1' is not a compiled character set and is not specified in
the '/usr/share/mysql/charsets/Index.xml' file
Database error: Cannot open database.
Last driver error: "QMYSQL: Unable to connect"
Last database error: "Can't initialize character set latin1 (path:
/usr/share/mysql/charsets/)"
Database error: Cannot open database.
Last driver error: "QMYSQL: Unable to connect"
Last database error: "Can't initialize character set latin1 (path:
/usr/share/mysql/charsets/)"</code>
 
then you're probably using a MySQL server which has a version > 5.1.42.
There is a known regression in MySQL 5.1.43 and 5.1.44 which prevents MySQL from starting.
 
See http://bugs.kde.org/226960 for more details.
 
 
=== Restarting after a previous error ===
If you had problems starting Akonadi and fixed those (such as a missing package or the Apparmor problem) make sure that the Akonadi server is completely shut down before trying to start it again, by calling '''akonadictl stop''' on the command line. You can confirm that it was indeed shut down completely by running '''akonadictl status'''.
 
Under some circumstances the Akonadi server can be stuck in a partially running state after a failure which will prevent the next attempt to start it to fail as well. Please file a bug report if you run into this problem including the self-test report of the initial problem.
 
=== The so-called "Gentoo-Assert" ===
That's an especially nasty problem that so far only affects users of source-based distributions, most prominently Gentoo. It is named after MySQL assertions like the following example and is most likely caused by a MySQL protocol mismatch between the MySQL server and the client library or the Qt MySQL driver.
 
<code>
akonadiserver: libmysql.c:4301: setup_one_fetch_function: Assertion `param->buffer_length != 0' failed.
</code>
 
It is extremely hard to diagnose as the assertion mentioned above are only triggered sometimes. Instead you'll get a wide range of weird symptoms:
* ASAP protocol logs show successful creation of objects which are supposedly no longer available when the next commands accesses them again.
* SQL protocol logs show INSERT or UPDATE commands with values that mismatch the corresponding column types and nevertheless succeed.
* SQL protocol logs showing large apparently random record ids which are nevertheless considered valid.
 
References:
* http://forum.kde.org/viewtopic.php?f=20&t=61738
* http://bugs.gentoo.org/show_bug.cgi?id=267513
* https://bugs.kde.org/202623 (contains a possible solution)
* http://bbs.archlinux.org/viewtopic.php?id=78358
 
Possible solution: Rebuild the Qt MySQL driver after upgrading MySQL (which most likely caused this problem in the first place).


<!--T:9-->
[[Category:System]]
[[Category:System]]
</translate>

Latest revision as of 07:00, 10 August 2024

Introduction

The Akonadi framework is responsible for providing applications with a centralized database to store, index and retrieve the user's personal information. This includes the user's emails, contacts, calendars, events, journals, alarms, notes, etc.

Currently, all KDE PIM applications with the exception of Akregator are using Akonadi to access user's PIM data.

Controlling Akonadi

Akonadi will start automatically in the background when any application using it is started.

To manually start, stop or restart Akonadi, you can use the akonadictl command from the commandline. Using this method, you can get additional useful information on the console.

To start the Akonadi server,

akonadictl start

To stop the Akonadi server,

akonadictl stop

To restart a running Akonadi server,

akonadictl restart

To query the status of the Akonadi server,

akonadictl status

Disabling the Akonadi subsystem

The Akonadi server is automatically started by any Akonadi-enabled application. If you don't want Akonadi to be started after login, you have to ensure that no Akonadi-enabled application is launched at login or thereafter. Remember to check Plasma applets as well — the Digital Clock widget in the default panel, for instance uses Akonadi to (optionally) display calendar events and this is enabled in its settings by default (see the "Display Events" option) . You must remove any widgets that may start it from your start-up, if you wish Akonadi to start only when you start KMail or other applications.

Remember

If you don't want to have Akonadi running on your system at all, you can not use any of the Akonadi-enabled applications, such as KMail, KOrganizer or KAddressbook. Such applications will not work when Akonadi is disabled using the steps below. Also note, that some Plasma widgets, such as the Digital Clock uses Akonadi.


To ensure that Akonadi is not started, check that no applications require it at login. In particular, open the Plasma clock applet preferences, go to Calendar and uncheck Show events to prevent Plasma from requesting information from Akonadi and thus allowing it to start.

Some Definitions

Real data
By real data we mean the data, like the contacts or events. These data are stored either on a groupware server or in local files. Where exactly depends on the resource you are using. E.g. the Personal Contacts resource stores its data under $XDG_DATA_HOME/contacts.
Cached data
The cached data are copies of the real data that are kept in the database for faster access and offline caching. The database also keeps the meta data which are management data needed by Akonadi to work correctly.
Configuration data
The configuration data are the data that configure the Akonadi server and the individual resources. The general configuration data for the server can be found under $XDG_CONFIG_HOME/akonadi. The configuration data for each indvidual resources are stored under $XDG_CONFIG_HOME/akonadi_xyz_resourcerc# (xyz is name of resource and # its instance number).
The Akonadi server configuration is a couple of files in $XDG_CONFIG_HOME/akonadi. It contains which data sources and helper programs are active and will be started and watched (so they can be restarted on crashes) by one of Akonadi's server processes (akonadi_control).
Each data source handler (called resources) or helper program (called agents) can have its own configuration although some agents or resources don't require configuration. The general rule is that for every entry in $XDG_CONFIG_HOME/akonadi/agentsrc there is a corresponding configuration file in $XDG_CONFIG_HOME. For example, if the [Instances] section in agentrc contains an entry for akonadi_ical_resource_2, there is also a config file called akonadi_ical_resource_2rc in the $XDG_CONFIG_HOME directory.
Depending on the type of data, such config files for resources will have filenames or directory names of where the data is stored. Common locations are KDE's legacy default files, e.g. $HOME/.kde/share/apps/korganizer/std.ics. New default locations are files and directories in $XDG_DATA_HOME, e.g. $XDG_DATA_HOME/contacts.

Backup

So now we need to decide what to back up. If you want to backup the "real data", then it depends on the resources you have configured... if you use a groupware server, then the backup should be done there. For contacts, the files under $XDG_DATA_HOME/contacts will normally be what you need.

To back up the entire Akonadi configuration, including which resources are active and their configuration, you can use the pimdataexporter' tool. This, however doesn't back up the Akonadi database containing the cached data and, unfortunately, after restoring the configuration (using the pimdataexporter again), Akonadi will have to re-fetch all data again into its cache. This can cause configuration that points to actual mail folders or calendars to get broken and accidentally point to another folder.

After restoring configuration and syncing all data, it's vital to manually check all folder configuration, especially in KMail identities and make sure the folders are configured properly.

Frequently Asked Questions

Where is my data now?

Your data are safely stored outside of Akonadi control on your disk (e.g. local maildir folder or iCal calendar), or on a remote server (in case of e.g. email over IMAP or events from a CalDAV calendar). Akonadi will optionally store a copy of this data in its database to allow applications to quickly retrieve and display them. Any modifications done to data in the Akonadi database will be synced to the actual storage. The main advantage of using the database as a cache is that remote PIM data are available even when you are offline, and you can still interact with them (e.g. mark emails as read or move them, create new events, reschedule existing meetings etc.) and all the changes will get synced automatically once you connect to the internet again.

Thus, deleting the Akonadi database will not cause any data to be lost (as long as all pending changes are synced).

How to upgrade my PostgreSQL database?

After updating your PostgreSQL server to a new major version, sometimes you will have to convert your Akonadi database for use with this new version. Instructions can be found on this page.

Migration problems

Akonadi's Glossary entry has a brief description of Akonadi's purpose, and other useful links.

How do I switch from MySQL/PostgreSQL to SQLite?

Since Akonadi 6 akonadi-db-migrator is included in akonadi that allows you to switch the database backend. Where for previous versions this involved deleting and recreating the database a migration is now properly supported by akonadi.

The tool needs to be called with the parameter --newengine to chose to which backend it should to: {{{

 --newengine <ENGINE>       The new DB engine to use. Possible values are 
                            "sqlite", "mysql" and "postgres"

}}}

For example: {{{ akonadi-db-migrator --newengine sqlite }}}