Migrating from KMail to Thunderbird: The revenge

After migrating 2 of my kids and my wife from Kmail to Thunderbird last year, I finally decided this week-end to finish the last migration for my first daughter on her Mageia distribution.

I previously made unsuccessful tries, as her environement was different, with many more subdirectories, and special chars, so it didn’t work with the previous version of the script.

Now with the revisions 1389 and 1390 of the md2mb.pl script, I have successfully migrated her environment, without any manual intervention.

Hopefully, seeing the number of times the previous post was looked at, it will be again useful (even more now that it works better:-)) for others. I even clarified the license in revision 1391 for you to use more easily.

Happy migration !

About these ads

Tags: , , , , ,

16 Responses to “Migrating from KMail to Thunderbird: The revenge”

  1. FACORAT Fabrice Says:

    You saved my day !
    I planning to migrate some users away from Kmail as it can no longer be used reliably with /home on NFS :(
    Does your script could work with evolution ?

  2. brunocornec Says:

    Well, in fact it should work for a migration from maildir to mailbox, what ever the tool used. The only hard coded aspect is that at the end it migrates the KMail inbox content to the Inbox of TB.

    I never used evolution (too buggy for me when I tried years ago, and I’m a die hard mutt user ;-)) so I wonder whether it’s using the /cur/, /new/, /tmp/, … subdirs as well. If not, you’ll have to adapt that part as well. Let me know.

  3. FACORAT Fabrice Says:

    I’m wiling to contribute and do some tests with evolution.
    Is there’s a way to contribute and do a checkout ? or do I have to download the source and send you diff ?

  4. brunocornec Says:

    The easiest would be what you propose (sending a patch based on my tree). If you plan to make lots of modifications, I could isolate that part of the tree and give you SVN write access.

  5. Robert Grasso Says:

    Hello,

    First, one word : THANK YOU ! I recovered all my emails in TB !

    I got your script from trac here :

    http://trac.project-builder.org/export/1391/projects/md2mb/devel/md2mb/bin/md2mb.pl

    There have been some glitches – as I have not been developing for a very long time, unfortunately I won’t take the risk of contributing code – but I will describe my tiny issues :

    I am using a hugh directory structure in my email client, and your script did not recover it entirely; actually :

    - the Inbox mbox itself was recovered correctly with the name :

    Inbox

    - whereas my inbox sub-directory was created with the name

    inbox.sbd (initial lowcase `i’)

    changing the initial `i’ to uppercase `I’ fixed the issue and gave me access to my structure

    - in Kmail, I created several parent directories, in which I never dropped emails – instead, I directed the emails into the subdirectories; your script created successfully the sub-directories, such as

    MySubdir.sbd

    but I could not access them : I had to create empty files such as

    `MySubdir’ (taking care of the case !)

    in order to get access to my structure

    Fortunately, these were minor bugs.

    Regards
    R. Grasso

  6. markus Says:

    Thank you very much!
    That was as painless as migrating kmail should have been.
    I for one would have found a comment line useful, that informs me, that procmail is necessary. It’s not an issue, but would have made the whole experience even smoother.

    • brunocornec Says:

      I just added a message when aborting dur to the lack of formail, than procmail may what you want ton install. Thanks for your feedback.

  7. md2mb.pl improved to better support migration from Kmail to Thunderbird « Bruno Cornec’s Blog Says:

    [...] have to do the stuff twice, and thus a script is useful !! And it was prooved again when I migrated my last kid with it again. And the script was improved at the same time. But I knew there were still some flaws, as one [...]

  8. BASTA! Says:

    The link in the post is not a direct download link. How do I download this thing?

  9. e. Says:

    hello!

    first thanks a lot, i really need this as running away from kmail after recent upgrade from ubuntu 10.04 to 12.04. And kmail cannot make a proper backup, (failure in packaging) and is even not showing my 2 gigs of mail after configuring a dimap account… Terrible. 2 days working, and no advancement….

    but as i am a total newby in pearl. I prob do something wrong
    what is ist?
    i put my $subdir = s;
    but then…..

    Semicolon seems to be missing at md2mb1.pl line 52.
    at md2mb1.pl line 52
    Global symbol “$touch” requires explicit package name at md2mb1.pl line 38.
    Global symbol “$touch” requires explicit package name at md2mb1.pl line 38.
    syntax error at md2mb1.pl line 53, near “pod2usage”
    (Might be a runaway multi-line ;; string starting on line 38)
    Global symbol “$touch” requires explicit package name at md2mb1.pl line 116.
    Execution of md2mb1.pl aborted due to compilation errors.
    at md2mb1.pl line 214

    Hope you find time to tell me..

    thanks

    e.

    • brunocornec Says:

      perl -c ~/pb/projects/md2mb/devel/md2mb/bin/md2mb.pl
      /users/bruno/pb/projects/md2mb/devel/md2mb/bin/md2mb.pl syntax OK

      So it’s linked to your environment. You seem to be missing some required perl modules:

      grep use ~/pb/projects/md2mb/devel/md2mb/bin/md2mb.pl
      use strict;
      use File::Find;
      use File::Copy;
      use File::Basename;
      use File::Path;
      use File::Glob ‘:glob’;
      use Getopt::Long;
      use Pod::Usage;
      use List::Util qw(first);

      So on Ubuntu you should have something like libfile-find-perl, and similar stuff for the other modules. In particular libpod-usage-perl seems to be missing from what you gave as error messages.

      Hope this helps,
      Bruno.

  10. erik. Says:

    thanks Bruno.

    while executing this with touch library installed:

    $ perl md2mb.pl -d

    Semicolon seems to be missing at md2mb.pl line 51.
    Global symbol “$touch” requires explicit package name at md2mb.pl line 38.
    Global symbol “$touch” requires explicit package name at md2mb.pl line 38.
    syntax error at md2mb.pl line 52, near “pod2usage”
    (Might be a runaway multi-line ;; string starting on line 38)
    Global symbol “$touch” requires explicit package name at md2mb.pl line 115.
    Execution of md2mb.pl aborted due to compilation errors.

    while i did install the touch library

    libfile-touch-perl

    /.
    /usr
    /usr/share
    /usr/share/doc
    /usr/share/doc/libfile-touch-perl
    /usr/share/doc/libfile-touch-perl/changelog.Debian.gz
    /usr/share/doc/libfile-touch-perl/changelog.gz
    /usr/share/doc/libfile-touch-perl/copyright
    /usr/share/man
    /usr/share/man/man3
    /usr/share/man/man3/File::Touch.3pm.gz
    /usr/share/perl5
    /usr/share/perl5/File
    /usr/share/perl5/File/Touch.pm

    - It states it cannot find it… why? (my thoughts, because it is not in the getOptions ( ???)
    - that semicolon at line 51, what is the problem, it is there.
    (so I added two semicolons, and this fault ended. so line 38 becomes my $subdir = s;;; )

    then output of perl md2mb.pl -d
    syntax error at md2mb.pl line 39, near “my ”
    Global symbol “$touch” requires explicit package name at md2mb.pl line 39.
    Global symbol “$touch” requires explicit package name at md2mb.pl line 48.
    Global symbol “$subdir” requires explicit package name at md2mb.pl line 51.
    Global symbol “$touch” requires explicit package name at md2mb.pl line 115.
    Execution of md2mb.pl aborted due to compilation errors.

    another Note
    the md2mb.pl which Robert Grasso mentions above, that one runs well in debug mode. Will it not be a good option to state the version of the md2mb file inside the script?

    Thank you very much!

    • brunocornec Says:

      > $ perl md2mb.pl -d

      > Semicolon seems to be missing at md2mb.pl line 51.
      > Global symbol « $touch » requires explicit package name at md2mb.pl line 38.
      > Global symbol « $touch » requires explicit package name at md2mb.pl line 38.
      > syntax error at md2mb.pl line 52, near « pod2usage »
      > (Might be a runaway multi-line ;; string starting on line 38)
      > Global symbol « $touch » requires explicit package name at md2mb.pl line 115.
      > Execution of md2mb.pl aborted due to compilation errors.

      I think that you’re mising the File:Glob module in fact. try apt-get install libfile-glob-perl as root.
      It should help solve the bsd_glob call at line 33, which is probably undefined now, and could lead to the errors in line 38 you’re seeing.

      If it’s not sufficient, then go one with nthe next modules.
      Some modules are part of perl, so are not available separately, some others not, and you’ll have to check that they are indeed installed.

      >
      > while i did install the touch library

      > libfile-touch-perl

      THat module is not needed by my program.

      > another Note
      > the md2mb.pl which Robert Grasso mentions above, that one runs well in debug mode. Will it not be a good option to state the version of the md2mb file inside > the script?

      It could. But it doesn’t really have one as of now because it wasn’t supposed to become popular to so many users it could require such a feature. But that’s something I could add, as well as native packages for distributions, in order for you to install/use it more simply. THat’s something I can work on when I have a bot more time.

  11. erik Says:

    >I think that you’re mising the File:Glob module in fact. try apt-get >install libfile-glob-perl as root.

    not in ubuntu reps.
    how can i check if i have it?
    ps, if you have time, just communicate through email. so your blog doesnot become so dirty….

    thanks

    e.

  12. erik Says:

    Bruno

    I did it!

    thanks one million times!

    note, the input output folders should end with /
    if not, a big loop starts…
    and make it more clear that in the command line the output folder should be mentioned. And all troubles solved. (I hope I can enjoy thunderbird. it is still creating msf files)

    (ps, I normally think a program is there to be run, so don’t read the bottom lines)

    thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 100 other followers

%d bloggers like this: