SOLVED How do you copy emails from an account to another account as ad-don account while retaining all email list, emails and passwords?

Sarik

Registered
Oct 23, 2019
4
1
3
Nepal
cPanel Access Level
Reseller Owner
Due to the recent changes in cPanel pricing, we have decided to use addon domains to host multiple domains in a single account. These domains are only using emails, so resource choking ( other than emails) should not be an issue.

The problem is, I have to recreate each email for each domain with new passwords, give the new passwords to clients, and then they have to re-setup their mail clients again. Is there a way to restore only emails, email list and passwords from individual accounts to addon domains without replacing other's content?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
This is possible but it could be a bit tricky if you're not sure of what you're doing. The steps are as follows:

Part 1: Move the password, setup and configuration files:
  1. Go to /home/originaluser/etc/
  2. In this folder you will see all the domains that have email on that cPanel account.
  3. Locate the folder for the domain's email you would like to move
  4. Create a backup of the folder
    Code:
    cp -R /home/$USER/etc/domain.tld{,.}
  5. move the folder to the new location (if it's located on the same server)
    Code:
    mv /home/originaluser/etc/domain.tld /home/newuser/etc/
  6. Update UID accordingly
    Code:
    chown -R newuser /home/newuser/etc/domain.tld
Part 2: Move the actual mail
  1. You can do this a couple of ways:
  • You can rsync the data from /home/originaluser/mail/domain.tld to /home/newuser/mail/domain.tld/
  • You can manually move the file in the same manner as done in the previous example​

By Email List are you referring to Mailing Lists? If so I don't think the same steps would be usable.
 

Sarik

Registered
Oct 23, 2019
4
1
3
Nepal
cPanel Access Level
Reseller Owner
Hello,

Thanks for the answer. Sorry for being a complete newbie in this matter.

I copied the folders domain.tld from /etc and /mail folders to the respective folders of the addon domains. However, I can't see those emails in the list of emails. I found this tutorial too: Transfer Your E-mail From One cPanel to Other Without Losing a Single Mail - BuycPanel

You mentioned I have to update UID's accordingly too, but I'm a bit confused on that. Is it possible to do so without CLI access?

Even if I did have CLI access, does 'newuser' refer to the cPanel user ID of the main cPanel accounts where the addon domain is residing?
 
Last edited by a moderator:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
Hello,


The username (UID) needs to match that of the username of the account the mail is now on. The article notes and my last response indicates you can do this over FTP.