Move email accounts from one cPanel account to another

Move email accounts from one cPanel account to another

Moving email accounts along with all emails from one cPanel to another can be done in two ways:

  1. IMAPSync – you need access to a terminal and passwords for email accounts
  2. FTP (File Manager) – you need access to FTP or cPanel File Manager on both cPanels

Migrating email accounts from one cPanel to another using cPanel File Manager

I recommend this option for non-tech users as all you are doing is creating new email accounts and then copying emails to them.

Step 1. Create a new email account on the new server

On the new cPanel server navigate to Email accounts and create all the email accounts that you wish to migrate. If you don’t know the passwords, but want to keep them the same as on the old host, then just set a random password now, and later in step 4. you can copy the old password from the old cpanel.

image 131 - Move email accounts from one cPanel account to another

Step 2. Download emails from the old server

In cPanel emails are stored for each account under mail/DOMAIN/EMAILACCOUNT, for example, emails for account info@pcx3.com are stored under mail/pcx3.com/info

To copy those emails, simply open this folder from cPanel File Manager and create an archive from both the cur and new folders.

chrome Etcm9oDiSv - Move email accounts from one cPanel account to another

Then download this archive to your computer.

image 133 - Move email accounts from one cPanel account to another

Step 3. Upload files to the new server

Go back to the new server and navigate from File manager to the same directory mail/DOMAIN/EMAILACCOUNT then upload the downloaded archive here.

image 134 - Move email accounts from one cPanel account to another

Delete the cur and new folders

image 135 - Move email accounts from one cPanel account to another

then extract the uploaded archive.

image 136 - Move email accounts from one cPanel account to another

Once it is done, you will have all the emails from the old server.


Step 4. (optional) Copy passwords from the old server

Passwords are stored encrypted in cpanel so you cant really see them, but you can copy them. They are stored in mail/DOMAIN/EMAILACCOUNT so if you want to keep all passwords the same, just copy these files from the old server to the new one.

image 137 - Move email accounts from one cPanel account to another

Step 5. Change DNS so that new emails can be received on the new server

A mail exchanger record (MX record) specifies the mail server responsible for accepting email messages on behalf of a domain name. Once we have copied all the emails, we have to point the MX record to the new server, so that new emails get delivered there.

To change MX record, you have to enter the DNS zone of your domain and change this record.

https://developers.cloudflare.com/dns/manage-dns-records/how-to/email-records/

For instructions on how to do this please contact your hosting provider.


Migrating email accounts from one cPanel to another using IMAPsync

imapsync is an IMAP transfer tool that can be used to copy emails from one server to another. this tool has to be installed on a Linux server before it is used, but you don’t have to install it on either new or old server. For example, you can install it locally on your Linux OS.

First, install imapsync

yum install epel-release
yum install imapsync

Then migrate emails using the following command:

imapsync --host1 'mail.server1.com'  \
	   --user1 'email@domain.com' 	    \
	   --password1 'password'  	    \
	   --ssl1			    \
	   --host2 'mail.server2.com'   \
	   --user2 'email@domain.com'	    \
	   --password2 'password'  \
	   --ssl2 

Replace information per your need:

mail.server1.comOLD SERVER
mail.server2.comNEW SERVER
email@domain.comEMAIL ADDRESS
passwordEMAIL PASSWORD

And run the command in the terminal. It will go through all folders and copy all emails one by one.


whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.