web analytics

Migrating emails from mailenable to exim

I wanted to transfer my entire sites from my Windows Plesk server to Linux Cpanel server. I could simply create the new accounts in the new server and copy the files. The main issue was with emails. My windows server was using mail enable, where as the the cpanel server uses exim.

I realized I will have to create all email accounts manually in the new server. A simple tool which will do everything in a click was not available. Losing email was not something I could let happen, so I decided to go ahead with creating accounts and then copying emails. I used imapcopy for it. If anybody wants to do it, you can do it as follows. I am copying the email account test@abc.com to new server. Its password is test123c on both servers.

root@abc [~]# cd /usr/local/src/

root@abc [/usr/local/src]#  wget http://home.arcor.de/armin.diehl/imapcopy/imapcopy.tar.gz

root@abc [/usr/local/src]#  tar -xvf imapcopy.tar.gz

root@abc [/usr/local/src]# cd imapcopy

root@abc [/usr/local/src/imapcopy]# ls
./  ../  imapcopy*  ImapCopy.cfg

root@abc [/usr/local/src/imapcopy]# cp -pv ImapCopy.cfg ImapCopy.cfg.original

`ImapCopy.cfg’ -> `ImapCopy.cfg.original’

root@abc [/usr/local/src/imapcopy]# vi ImapCopy.cfg
You need to edit the following values to make the migration smoother.

##############
# Sourceserver
##############
SourceServer 1.2.3.4 (Source Server IP Address)
SourcePort 143
###################
# Destinationserver
###################
DestServer localhost
DestPort 143

#############################
# List of users and passwords
#############################

#       SourceUser    SourcePassword   DestinationUser  DestinationPassword
Copy   “test@abc.com”  “test123c” “test@abc.com”  “test123c”

Make sure you are able to connect to port 143 of source server from destination server

root@abc [/usr/local/src/imapcopy]# telnet 1.2.3.4  143
Trying 1.2.3.4…
Connected to abc.greproot.com (1.2.3.4).
Escape character is ‘^]’.
* OK IMAP4rev1 server ready at 05/07/14 05:46:17
^]
telnet> q
Connection closed.

Now test the configuration

root@abc [/usr/local/src/imapcopy]# ./imapcopy -t
IMAPCopy 1.04 – 2009/07/18 [compiled with FreePascal]
written 2001-2009 by Armin Diehl <ad@ardiehl.de>
Running on Linux

Login on sourceserver as test@abc.com OK
Login on destinationserver as test@abc.com OK
Getting folderlist on sourceserver OK, found 1 folder

1 User processed, 0 Messages copied, 0 Error(s)
0 Folder(s) created, 0 Folder create errors, 0 Folder not copied

The configuration looks fine without any errors. Now we can start copying the email account contents.

root@abc [/usr/local/src/imapcopy]#./imapcopy
IMAPCopy 1.04 – 2009/07/18 [compiled with FreePascal]
written 2001-2009 by Armin Diehl <ad@ardiehl.de>
Running on Linux

Login on sourceserver as test@abc.com OK
Login on destinationserver as test@abc.com OK
Getting folderlist on sourceserver OK, found 1 folder
Getting List of messages in “INBOX” OK, 7 Messages found
Processing Folder INBOX
7 Messages copied, 0 Errors

1 User processed, 7 Messages copied, 0 Error(s)
0 Folder(s) created, 0 Folder create errors, 0 Folder not copied

Now the mails have been copied. Try accessing webmail of the account test@abc.com and see if mails are displayed fine.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>