Moving an email account (including old emails) from one cPanel server to another is pretty easy to do yourself if you have some knowledge of cPanel and FTP. When you move your existing web 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 within 5 to 10 minutes.
Here is a step by step approach to successfully move your cPanel mail from OLD server to NEW Server.
Log on to the New Server CPANEL. Click the ‘Email Accounts’ icon and fill up the fields 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/unlimited you want.
Use a FTP program like CuteFTP, filezilla or FireFTP to connect to the Old Server. From the root directory navigate to “mail/domainame.com/emailAccount”. There will be a lot of files there but we need just two folders. So, download the “new” and “cur” directories to you local machine. Save this as a back-up of your old mails. If you have a lot of emails this could take a while. Once you are done, log out of the FTP connection.
Log in to the New Server and like we did on the Old Server.
Navigate to the “mail/domainname.com/emailaccount/” directory.
Upload the “new” and ”cur” directories here by overwriting the existing one.( Replacement needed as the folder should already be created since you already created the account in step 1.)
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.
(Alternate Process: FTP to the OLD SERVER, open up the maildirsize file at “root/mail/domainname.com/emailAccount” and copy all of the contents and paste them into the maildirsize file on the NEW SERVER. You may have luck copying the maildirsize file on the OLD SERVER and pasting it on the NEW SERVER, however this did not work for me.)
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.
You can update name servers 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, but sometimes DNS propagation might be done within 15 minutes
(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.
Enjoy your time. Have fun.
Thanks for reading this.