How to Migrate the Contents of Email Accounts in Addon Domains
Last modified: July 27, 2023
Overview
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_account
represents the cPanel account from which you wish to move the addon domain’s email account or accounts.new_account
represents the cPanel account to which you wish to move the addon domain’s email account or accounts.domain_name
represents the addon domain’s name.email_account
represents 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 interface (cPanel » Home » Domains » Domains). However, the contents for these emails accounts still exist in the /home/old_account/mail
directory.
If you wish to permanently remove the contents of these accounts, run the following command on the command line as the root
user:
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:
-
Use cPanel’s Email Accounts interface (cPanel » Home » Email » Email Accounts) to add new accounts, or run the addpop script to manually add new email accounts.
-
Run the following command on the command line as the
root
user 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