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

Start akonadi migration all over

Tags: kmail, akonadi, migration, korganizer, mail kmail, akonadi, migration, korganizer, mail kmail, akonadi, migration, korganizer, mail
(comma "," separated)
alvanx
Registered Member
Posts
136
Karma
1
OS

Start akonadi migration all over

Sat Jul 23, 2011 9:45 pm
Kmail freezes up my system for minutes whenever I manually check for new mail. Korganizer doesn't remember me deleting tasks or appointments, which is extremely tedious. These problems might come from old akonadi config files as well as killing akonadi when it was causing these huge memory peaks before learning this might cause data loss.

I have opened theads here for both (1) (2). There hasn't been a solution (except to my first kmail-related problem about not being able to send mail, which was solved.). Now I would like to start my akonadi migration again. How can I go back and start all over? And would this actually solve my problems? Simply renaming .local/share/akonadi/, as was suggested, doesn't do it.

I have two questions that I would also like to know answers to:
1. I imported my emails from Thunderbird just a few weeks ago. Where does Kmail import them to? I sometimes read that they should be in .kde4/share/apps/kmail, but that folder doesn't exist on my system. There is also no /home/[user]/Mail folder, and .local/share/local mail/ is empty as well. Still, they are obviously stored somewhere. Why is this so hard to find out?
2. Would I keep my Nepomuk tags? For instance, I have tagged many people in my address book. Would those tags be gone? How about tagged email?

KDE "officials" have been emphasizing that it should be no problem to go back to KDEPIM 4.4 in case 4.6 didn't work for you, yet I haven't found a single Howto about migration - not even going from 4.4 to 4.6, for that matter. Also, absulutely nobody seems to know where Kmail puts all the mail! (See e.g. here) It would be nice to get some definitive answers. How can I start all over again with Akonadi?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
First, you'll need to remove the various Akonadi configuration files, after stopping Akonadi. They can be found in ~/.config and ~/.kde4/share/config and it's matching data from ~/.local/share/akonadi and ~/.kde4/share/apps

Then remove all *migratorrc files from ~/.kde4/share/config.
Next time you start Akonadi, it should initiate a migration.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
alvanx
Registered Member
Posts
136
Karma
1
OS
That did it, thanks! Though I still have to decide whether kmail has become faster and more responsive (seemed so at first, but now I'm not sure at all), at least KOrganizer is working again.

I noticed 2 things:
Firstly, some of my emails now have random tags. Any way to mass-remove those?
Secondly, kmail now put at least some of my emails into the random directory .local/share/akonadi/file_db_data/. (This folder has close to 15.000 text file entries, while I have a few thousand more when I add up the numbers from my different folders as shown in kmail. Maybe this is only the messages I reimported.) The thing is, my mail never used to be there before. How can this be and where is the rest?

Redoing the migration has also brought my attention to the akonadi agent "Local Folders". It doesn't seem to do anything. I can't tell it to fetch my mail for me. But, it points to the path ~/.local/share/local-mail/. Except my mail isn't stored there. Another piece of the puzzle is that when I have those memory peaks, which happen whenever I manually fetch mail, what leaks all that memory is syncing "Local Folders". Could there be something broken in that this agent is trying to do something and failing, or something else isn't working right?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The copy of your email stored under ~/.local/share/akonadi/file_db_data/ is simply a cache. If these messages are cached copies of messages stored locally, please file a bug at bugs.kde.org as this is not supposed to occur.

The odd tags are probably a result of Nepomuk. You can erase the contents of the Nepomuk database if you wish, without needing to remigrate to Akonadi. If you use Nepomuk disk indexing however, it will need to reindex.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
alvanx
Registered Member
Posts
136
Karma
1
OS

Re: Start akonadi migration all over

Mon Aug 01, 2011 12:40 pm
Ok, that is good to know. In the meantime, I've done this twice, once for 4.6 and once for 4.7, and it hasn't solved any of my problems. What did help my memory problem was starting with a new Nepomuk database! Mine was a few Gigabytes big.
Unfortunately, new problems keep surfacing. Right now, none of my folders will load their contents. Previously, I had a problem to where the folders would be loaded, but the Kmail GUI would freeze up as soon as I selected an email to load (bug report here). Fortunately, I was able to solve this with a new Local Folders agent - and a new akonadi database.

I've learned a few things that I just want to put down here for the benefit of the general public. There does not seem to be any kind of documentation where this info can be found. Unfortunately, this is the kind of questions anybody would run into who naively believed that KDEPIM 4.6/4.7 was ready for productive use and then ran into as massive problems as I have.

The purpose of the Local Folders agent is to display your email in Kmail. No Local Folders, no display of mail. I am not sure what exactly it does when it "syncs", but it seems that it loads the new mail that was temporarily stored in Akonadi's cache at ~/.local/share/akonadi/file_db_data/ into the actual directory where your mail is stored, normally ~/.local/share/local-mail/.
Also, when you have a problem with Kmail freezing up while loading folder contents, try deleting Local Folders, then restart Kmail and Akonadi. A new Local Folders agent will automatically be created that in some cases helps solve the problem.
DO NOT delete Local Folders and then create your own maildir resource that points to the Local Folders contents (e.g. ~/.local/share/local-mail/). Akonadi will still create a new Local Folders agent when you next start it! This results in two collections being shown in your kmail that both contain your emails - all of them unread. I had over 50,000 unread messages, and the second folder did not go away when I deleted the extra maildir resource - I had to delete my entire Akonadi database.

One more thing is that the standard location for your local mail in Akonadi is ~/.local/share/local-mail/. If this directory is empty, it's because your "Local Folders" folder doesn't contain any actual mail (that is, unless you have pointed your mail containing akonadi agent some place else) - because you store all your mail in subfolders of "Local Folders" like "Inbox" etc. The contents of these folders are stored in ~/.local/share/.local-mail.directory/. This is due to how Kmail stores the contents of your folder hierarchy.
Whenever you have subfolders in any place, Kmail stores them in ".[directory].directory". Let's say I have a folder named "Linux" as a subfolder to my Inbox folder, which itself is a subfolder of Local folders. The mail that is in that folder will be stored in ~/.local/share/.local-mail.directory/.Inbox.directory/Linux.
User avatar
ooker
Registered Member
Posts
121
Karma
1
I don't have .kde4 but I have .kde, are they equivalent?
alvanx
Registered Member
Posts
136
Karma
1
OS
Yes! You probably have Kubuntu or another distribution that uses ".kde" rather than ".kde4".


Bookmarks



Who is online

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