Like many others, I spent a lot of time trying to recover my Evolution data after upgrading to Mint 12. I could not find a Web page where everything was explained. The information was spread over too many Web pages. I therefore decided to write a small howto on this topic.
Evolution format changed from 2.32 to 3.x. In both cases, the data was stored in ~/.local/share/evolution/mail/local/ according to XDG Base Directory Specification (http://www.freedesktop.org/wiki/Specifi ... sedir-spec). Inside that data directory, the format and the tree structure changed.
2. The 2.32 format
In 2.32, each Evolution folder was stored on the hard disk with 4 files. One single file contained all the folder emails in Mbox format. This Mbox file and the Evolution folder had exactly the same name, e.g., Inbox, Outbox, Sent, Drafts... The 3 other files were metadata files related to the folder format and indexes. The 3 files had the same names than the Mbox file but with extensions .cmeta, .ibex.index, and .ibex.index.data. For example, you should have Inbox, Inbox.cmeta, Inbox.ibex.index, and Inbox.ibex.index.data in ~/.local/share/evolution/mail/local/.
When an Evolution folder folder_name contained or had previously contained another folder, a directory called folder_name.sbd was added to the 4 files. For example, for an Evolution folder called Mydir that contained other folders, you will find:
- Mydir (the Mbox file containing the emails stored in Mydir);
- Mydir.cmeta, Mydir.ibex.index, and Mydir.ibex.index.data (the 3 files associated to the Mydir Mbox file);
- Mydir.sbd (a directory containing the other subdirectories).
Main folder-------------|-Content of Main.sbd--|-Content of Sub3.sbd
---------------------------+----------------------------+----------------------------
----------------------------|-----------------------------|
----------------------------| Sub1----------------------|
----------------------------| Sub1.cmeta-------------|
----------------------------| Sub1.ibex.index--------|
----------------------------| Sub1.ibex.index.data-|
---------------------------|------------------------------|
Main---------------------|-Sub2-----------------------|
Main.cmeta-------------|-Sub2.cmeta-------------|
Main.ibex.index--------|-Sub2.ibex.index-------|
Main.ibex.index.data-|-Sub2.ibex.index.data--|
Main.sbd----------------|-----------------------------|
----------------------------|-----------------------------|
-----------------------------|-Sub3---------------------|-Sub4
-----------------------------|-Sub3.cmeta-------------|-Sub4.cmeta
-----------------------------|-Sub3.ibex.index--------|-Sub4.ibex.index
-----------------------------|-Sub3.ibex.index.data--|-Sub4.ibex.index.data
-----------------------------|-Sub3.sbd-----------------|
3. The 3.x format
In Evolution 3.x, the emails were stored in Maildir instead of Mbox format.
In Maildir format, a mail folder is composed of one directory (often called Maildir in Linux) containing 3 subdirectories called cur, new, and tmp. The subdirectory cur contains one file for each email of the folder, i.e., one file per email instead of one file containing all emails as in Mbox format.
So the Evolution file structure was accordingly modified. Each Evolution folder was stored on the hard disk with the same 4 components than in 2.32 except that the Mbox file was replaced by a Maildir directory with the same name. Furthermore, all folder names were preceded by '.' to make them hidden files. For example, your Sent folder had become .Sent, .Sent.cmeta, .Sent.ibex.index, and .Sent.ibex.index.data with .Sent being a Maildir directory containing the subdirectories cur, new, and tmp.
An evolution subfolder was stored in the same way with the folder names separated by a dot. For example, in the last example of the previous section, you should find .Main.Sub1, .Main.Sub2, .Main.Sub3, and .Main.Sub3.Sub4 Maildir directories in ~/.local/share/evolution/mail/local/ with the 3 corresponding Evolution metadata files for each Maildir directory.
Finally, ~/.local/share/evolution/mail/local/ has become your Inbox Maildir, i.e., you will find there cur, new, and tmp directories with cur containing all your Inbox emails.
4. Converting data format from Evolution 2.32 to 3.x
To avoid leaving any leftover of the previous version, I think it is best to get rid of the whole previous data and to rebuild the new one from scratch.
4.1 The easy way
Exit Evolution and move all the data from ~/.local/share/evolution/mail/local/ to an easy-to-reach place such as ~/tmp. This data contains all the Mbox files mentioned in section 2. Run Evolution and recreate your previous folder structure with the "Folder / New..." menu item. It should not take long. Then, import each Mbox file from ~/tmp to the right Evolution folder (Menu File / Import...). The procedure is self-explained once you start it. Of course, you must choose "Import a single file" instead of "Import data and settings from older programs" when you are requested to select one of these options. It is a good way to restore your emails if you only have a few folders to import. When you have many folders to restore, it can be boring and you might prefer to use shell commands.
4.2 A faster way if you love shell commands
If you have many folders to restore, you might prefer to do everything in bash to automate the process. It is possible to convert Mbox files to Maildir format and to recreate the Evolution structure detailled in section 3 in bash. For example, mb2md is a nice tool to convert Mbox files to Maildir format. Open a terminal and:
Code: Select all
$ sudo aptitude install mb2md
$ mkdir ~/tmp
$ cd ~/tmp
$ pushd ~/.local/share/evolution/mail
$ mv local ~1
$ mkdir local
$ cd local
$ mb2md -s ~/tmp/local/folder1 -d ~/.local/share/evolution/mail/local/.folder1
$ mb2md -s ~/tmp/local/folder1.sbd/sub1 -d ~/.local/share/evolution/mail/local/.folder1.sub1
When you have finished converting your data, you will need to build the metadata files. Evolution will take care of everything for you. Run Evolution then select each folder and let Evolution rebuilds its data and index metafiles. Just keep an eye on the bottom line of its window to be sure it has processed the data before leaving the folder for another one (when you leave a huge folder, you will see the process progress in the bottom line of Evolution window). Due to the lack of metadata, Evolution will duplicate all emails and it might also produce error messages telling you that he cannot read some emails. Do not pay attention, everything will be resolved soon. When you are done, exit Evolution to let it properly set all its metafiles. Rerun Evolution again and it will take care of the duplicated emails during this second pass. After a while, it will be over. You can exit Evolution again to let the software fix everything, then your are all set with Evolution 3.2 with all your mail folders