Linux Commands

How to migrate emails using imapsync tool

Migrate emails
Migrate emails

Migrate emails using imapsync

This post explains how to migrate emails using imapsync tool. Imapsync is an IMAP transfers tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts.

Please see this post to know how to Install imapsync on CentOS and Ubuntu systems. 

Install imapsync on CentOS and Ubuntu

Syntax:

imapsync --host1 <Source Server> --user1 <Source Email ID> --passfile1 <Path of file which includes Password> --host2 <Destination Server> --user2 <Destination Email ID> --passfile2 <Path of file which includes Password>

Example:

Here I am migrating an email account “neal@grepitout.com” from the source server “server1.grepitout.com” to the destination server “server2.grepitout.com”. Make sure that the email account “neal@grepitout.com” is existing on the destination server too.

Store the Source Email ID’s password on file “/root/sourcepasswd” and Destination Email ID’s password on file “/root/destinationpasswd“.

We can execute the following command from Source or Destination server or even any linux mechine which have imapsync tool. So, we don’t need shell access on Source and Destination server to migrate an email account.

imapsync --host1 server1.grepitout.com --user1 neal@grepitout.com --passfile1 /root/sourcepasswd --host2 server2.grepitout.com --user2 neal@grepitout.com --passfile2 /root/destinationpasswd

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Button

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Topics