Python imapcopy script

I needed to be able to move from Zimbra to Exchange 2007. After trying to use IMAPCopy and IMAPSync I became frustrated. IMAPCopy kept on crashing, IMAPSync was trying to look at changes back and forth, but I just want a fast straightforward copy to happen. The frustration of this process prompted me to write pyMAPCopy.

There is one issue with this code, it bails out on messages larger than about 5 MB. Other than that it works. I tested this on windows with ActivePython 2.5.

 To use this, get the file that is linked here and rename the extension from .txt to .py (remove the .txt part). Make sure you have installed activepython which is downloadable from the ActiveState website: http://www.activestate.com/Products/activepython/index.plex

Once this is installed, open a dosbox and browse to the folder that holds the script. Then type in pymapcopy.py and hit enter. You will be asked to type in the server names user names and passwords. Optionally this can be specified on the command line as well, type imapcopy.py -h for more info.

Download pyMapCopy

2 Responses to “Python imapcopy script”

  1. travis Says:

    have a few questions…

    I have not reviewed your tool, however we are getting ready to migrate from zimbra zcs 4.5.7 to exchange 2007, and it sounds like this would be very handy.

    Does this tool allow the sync of just mail, or does it also copy all calendar events, distro lists, recources and any other information?

    Regarding the question above, I would imagine this could be a pretty lengthy process… we have aprox 100 user accounts, 100 distro groups, several recources but more importantly 1000s and 1000s of calendar events/meetings with all planned with our meeting rooms. Any thoughts on the approximate time we would need to expect to be down?

    Any info would be much appreciated…

    Travis

  2. Wouter Simons Says:

    I have used this tool successful for a number of migrations, however, it is far from perfect. The migration from Zimbra to Exchange is painful to say the least.

    If you really want to be able ot migrate 100 users in a weekend or so you will want to use the exchange migration wizard that comes with Exchange 2003. Once you migrate all users to Exchange 2003 you can then upgrade to 2007. I do not know why MS has not provided this tool for 2007, but this is the best option I think.

    What we did is the following:
    1. We configured Exchange 2007 in our current environment with a gateway server using postfix which routes email to the Zimbra environment and Exchange by looking at the AD and the LDAP in zimbra.
    2. We setup a blackberry server with Exchange 2007
    3. One-by-one we moved users over. The mail was synched first with this script. After mail was migrated we used a PST file and manually copied over the calendar, tasks, and contacts.

    This took us about 4 hours per user. (We had about 200 accounts on Zimbra at that time.)

    In hinsight I would have used the migration tool in Exchange 2003, because 800 hours of effort is a lot!

    Hope this helps, and good luck with this painful process!

    Wouter

Leave a Reply