1 min read

Migrate email between servers using IMAP

I recently got a project to migrate hosting of domain but client also want to migrate  all their mails. Before changing Name server I have to ensure migration of email over IMAP email protocol using SSH works properly.  It doesn’t matter you are using Cpanel, directadmin  or anything else we need  IMAP email protocol  and SSH support.

Lets understand using some sample information, we have to to migrate Server 1’s email data to Server 2.

Server  1 details required :

  • domain name : suppose codentricks.com, IP of Server suppose 192.168.0.1
  • Email ID : server@codentricks.com
  • Password : ChangeSERVER*KJ

Now we have to create account on Server 2 with details given below and activate SSH

  • domain name : codentricks.com , we need IP of Server suppose 192.168.0.2
  • Email ID : server@codentricks.com
  • Password : ChangeSERVER*KJ

Now logging using SSH and run the code given below

imapsync --host1 imap.codentricks.com --user1 server@codentricks.com --password1 'ChangeSERVER*KJ' --ssl1 --host2 192.168.0.2 --user2 server@codentricks.com --password2 'ChangeSERVER*KJ' --ssl2
or
imapsync --host1 192.168.0.1 --user1 server@codentricks.com --password1 'ChangeSERVER*KJ' --ssl1 --host2 192.168.0.2 --user2 server@codentricks.com --password2 'ChangeSERVER*KJ' --ssl2
5 1 vote
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
ServerGuru

Thanks Sanjay, I have looked for solution(google) for last 7 days, it works for me