How to Migrate the Contents of Email Accounts in Addon Domains
Last modified: September 28, 2020
This document describes how to delete or migrate the contents of email accounts in addon domains.
- To create an email account on an addon domain, use cPanel’s Email Accounts interface (cPanel >> Home >> Email >> Email Accounts).
- To manage an addon domain, read cPanel’s Addon Domains interface documentation (cPanel >> Home >> Domains >> Addon Domains).
In the following examples:
old_accountrepresents the cPanel account from which you wish to move the addon domain’s email account or accounts.
new_accountrepresents the cPanel account to which you wish to move the addon domain’s email account or accounts.
domain_namerepresents the addon domain’s name.
email_accountrepresents the name of the addon domain’s email account that you wish to move.
Addon domain deletion
When you remove an addon domain, its email accounts will no longer appear in cPanel’s Domains (cPanel >> Home >> Domains >> Domains) interface. However, the contents for these emails account still exist in the
If you wish to permanently remove the contents of these accounts, in the command line or via a Terminal session, run the following command:
rm -R /home/old_account/mail/domain_name
Addon domain moved to another account
If you move an addon domain to a different account, you must add the addon domain’s email accounts manually and move the contents of those email accounts manually. The email accounts must follow the same name and domain format that they previously followed.
Perform the following steps to migrate the contents of the mail accounts:
In the command line or via a Terminal session, run the following command to move all email accounts to the new account:
mv /home/old_account/mail/domain_name /home/new_account/mail
Run the following command to change ownership of the files to the new account:
chown -R new_account:new_account /home/new_account/mail/domain_name.
Verify the ownership of the email accounts after you move them.
ls -alR /home/new_account/mail