Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

Migrate email between servers using IMAP

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