Your best bet for a clean migration is to use an IMAP migration tool (assuming both of your servers support IMAP). It avoids all of the issues surrounding the underlying databases used to store the mailboxes and messages since everything is done through IMAP commands.
There are lots of different IMAP tools out there, some free some not. Using an IMAP migration tool is usually straight-forward and simple. Here is a list of some of them. Full disclosure, imap_tools is mine. imapsync: http://imapsync.lamiral.info imap_tools: http://www.athensfbc.com/imap_tools offlineimap: https://github.com/nicolas33/offlineimap mbsync: http://isync.sourceforge.net/ mailsync: http://mailsync.sourceforge.net/ mailutil: http://www.washington.edu/imap/ part of the UW IMAP tookit. imaprepl: http://www.bl0rg.net/software/ http://freecode.com/projects/imap-repl/ imapcopy: http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html migrationtool: http://sourceforge.net/projects/migrationtool/ imapmigrate: http://sourceforge.net/projects/cyrus-utils/ larch: https://github.com/rgrove/larch (derived from wonko_imapsync) wonko_imapsync: http://wonko.com/article/554 pop2imap: http://www.linux-france.org/prj/pop2imap/ exchange-away: http://exchange-away.sourceforge.net/ To copy all of a user's mailboxes from one IMAP server to another using my imapcopy tool is as simple as executing the following command: imapcopy.pl -S source/username/password -D destination/user/password Regards, Rick