When you move your hosting to a different server you face the issue of migrating the emails from old cPanel to the new cPanel. Many a times I have seen website owner sacrificing all old mail during the server change process, because their developer does not know what to do. The fact is that it is a very easy process and can be completed before your pizza arrives.
Requirements :
Here is a step by step approach to successfully move your cPanel mail from OLD server to NEW Server.
You can update nameservers from your domain registrar. Go to the domain control area where you will need to change two entities from ns1. oldnameserver.com and ns2.oldnameserver.com to ns1.newnameserver.com and ns2.newnameserver.com. It takes somewhere between an hour to 24 hours to take effect. While this happens you can work on the next steps.
Log on to the cPanel on New Server. Click the 'email accounts' icon and fill up the simple form to create the email account. Make sure to keep the password same as the one you had on the Old Server. Choose any amount of disk space you want.
Use a FTP program like CuteFTP, filezilla or FireFTP to connect to the Old Server. From the root directory navigate to "mail/domain.com/emailAccount". There will be a lot of files there but we are interested in just two folders. Download the new and cur directories to you local machine. Save this as a back-up of your old mails.
Once you are done, log out of the FTP connection.
If you have a lot of emails this could take a while.
Log in to the New Server and like we did on the Old Server.
Navigate to the "mail/domain.com/emailaccount/" directory.
Upload the new and cur directories here by overwriting the existing ones.
Depending on the size of your mails it may take a while to upload them.
We are done, you can now access your mails from cPanel. But there is one bug to be fixed. Your mail account would still show you 0MB/500MB or something like that. That's because we just created the account, and cPanel never had any records of the mails coming in. So we have to update the Mail Quota.
In the same directory where we added the email files in step 3 locate the maildirsize file. Both the server will have the file. Copy the contents from maildirsize file on Old Server to the one on the NEW SERVER.
If the above step does not work for you, try editing the maildirsize file on New Server so that it matches the values on the Old Server.
For your information:
We are done now. (Remember the Nameserver may still need some time to update. Wait for it.) Your new email account should now have all the old mails and folder exactly like your Old cPanel email account. Have fun with the emails. Send one to me as a "note of thanks".