How to backup emails on cPanel

Whenever recreate the email account it is always better to take emails backup after that you can restore the backup for newly created email accounts.
For email account’s backup we need to login into shell as a root user and follow steps:

cd /home/cPanel-user/mail/
mkdir emailbackup
cd email-account-forwhichyouwantbackup
cp -p * ../emailbackup -R

Now delete and recreate the email account from cpanel as according to your requirement if emails are successfully copied after that restore the emails under newly created E-mail account.

cd /home/cPanel-user/mail/
cp * ../new-e-mail-account -pR

Type “yes” if want to replace.

Check all the e-mails would exist under the new E-mail accounts.