imapsync –host1 email.server1.com -user1 salman@server1.com –password1 passwordserver1 –ssl1 –host2 email.server2.com –user2 salman@server2.com –password2 passwordserver2 –ssl2
Steps
1] Collect mail1 and mail2 username & password and SMTP server
2] replace (email.server1.com) old server name
3] replace (passwordserver1) old server email id password
4] replace (email.server2.com) new server name
5] replace (passwordserver2) new server email id password
6] open new server terminal and run command