evol2tbird-addressbook.py (2004 06 06)
by Todd Warner <taw@pobox.com>
Public Key: http://www.pobox.com/~taw/taw-pubkey.asc   1024D/2C8A7691   0212 8177 4194 F27C 74EE 35A0 A03A 7167 2C8A 7691


UPDATE (2005-11-16)!

Evolution apparently now has a mechanism to export their address book into csv or vcard format. This should make it trivial to import the address book into thunderbird (use the cvs method). Unfortunately, it does not pick up all the details that you will get with my script, a script that I haven't tried in a long long time. :)

I got these instructions from a comment on an article at Linux.com:

"Use: evolution-addressbook-export --format=csv > file_name
Then it's an easy matter to import CSV format files into Thunderbird. You may need to open the CSV file and delete one column that Thunderbird doesn't have."

NOTE: your mileage may vary. I haven't tried that methodology. Mines better! :)

...back to the regularly scheduled program...

I wrote this script over a year ago to migrate my addressbook from Evolution to Thunderbird. It worked well then; it should work just fine now. The nice thing is that it will migrate a lot of the little meta-information you keep in address books about folks whereas the "csv" method from above will not. So... give it a try and tell me how it works for you.

From the docstring for evol2tbird-addressbook.py:

""" evolution --> thunderbird addressbook migration script

    Known to work with Ximian Evolution 1.2 and Mozilla Thunderbird 0.6.
    Or right about 2004-06-05.

    Both products are mail clients for Linux and other platforms. Both rock.

    This utility was written because Ximian Evolution (1.2) does not export its
    address book very well to other programs in general, and Mozilla
    Thunderbird (0.6) in particular. Both programs are at fault I think.

    I googled for a solution and got a half-baked python & perl script combo
    that did some of the job. Since I was not satisfied with that, I decided
    to spend a bit of time and write a more robust utility myself. I.e., it
    was one of those one-off programs that ended up expanding and taking way
    too much of my time!

    USAGE:
      ./evol2tbird-addressbook.py --db [path to evolution's addressbook.db]
      or
      ./evol2tbird-addressbook.py --vcard [path to evolution's exported vcards]

      (if no options are used the default is
       --db ~/evolution/local/Contacts/addressbook.db)
    
    How it works:
    o I iterate over the addressbook records in Evolution's bsddb Contacts
      database.
      -or-
      I iterate over the VCard records in a text file that Evolution exported.
    o as I pull in data, I translate that data into strings that are comma
      deliminated - Comma Seperated Values, or CSV.
    o this cvs output is *exactly* formated to what the Thunderbird mail
      client expects.

    What would be better:
    o Evolution needs to be able to convert the data to a more robust portable
      (and *sigh* more complex) format such as LDAP Data Interchange Format
      (LDIF) that anyone can parse. I am certain it is on their todo list.
    o Thunderbird needs to be able to import Evolution's exported VCards
      natively. Evolution is extremely popular. It only makes sense.
    o This utility would be better if it translated Evolution's VCard format
      to LDIF. Maybe I will do that one of these days. Don't hold your breath
      though. ;)

    License: CC-GNU LGPL v2.1

    Copyright © 2004-2005 Todd Warner 
    All rights reserved.

    Author: Todd Warner 

    See also:
        Ximian (Novell) Evolution: http://www.novell.com/products/evolution/
        Mozilla Thunderbird: http://www.mozilla.org/projects/thunderbird/
        CC-GNU LGPL v2.1: http://creativecommons.org/licenses/LGPL/2.1/
        LDIF: http://whatis.techtarget.com/definition/0,,sid9_gci549219,00.html
        VCard: http://www.free-definition.com/VCard.html

    Update (2005-05-11): Arsen Kostenko pointed out a flaw
                         s/EMAIL;INTERNET/EMAIL;TYPE=INTERNET
                         It may be an Evolution v2.* thing. I don't know. Hope
                         it works fine. :)
"""

Script and signature file (key):
  (sha1sum) 4df3c8fea3db9862e31b31916c341b9d34961f02   evol2tbird-addressbook.py
  (sha1sum) d0270bb81606daa2bef467f8d8d0c0a59b45535f   evol2tbird-addressbook.py.asc

A NOTE ABOUT DOWNLOADING evol2tbird-addressbook.py!
If you cut-n-paste the file into an editor or email client, it will not work. It's written in the Python programming language whick enforces strict discipline about white space. Instead, right click on the link and save or save as somewhere. Then it will (or should) work just fine for you.

See also:
  Ximian (Novell) Evolution
  Mozilla Thunderbird
  CC-GNU LGPL v2.1
  LDIF
  VCard


<-- back to main page
Last updated: $Date: 2005-11-16 23:25:05 -0500 (Wed, 16 Nov 2005) $