Maybe you’ll want to merge two separate cPanel accounts on the same server, but you won’t be able to, because you can’t simply just delete domain from the first account, and you can’t add domain to the second account because it exists on the first one :).
You can migrate email and other user data simply, by creating backup of user account and delete it from cPanel. Below, I will show how to migrate just email. But you can also migrate websites like this.
- Make copy of primary user account (if websites, also make sure to dump databases of that user)
root@cpanel [/home]# cp -rp useraccount1 useraccount1.bak
- Make copy of email aliases of primary account so they wont get lost after delete of primary account
cp /etc/valiases/userdomain.com /etc/valiases/userdomain.com.bak
- Delete primary user account in cPanel – useraccount1 in our case
- Add domain of primary account to secondary account (useraccount2). Now you’ll be able to, because domain don’t exist on the system anymore.
- Copy settings from primary account from backup to secondary one (the one you added domain to) and set right permissions:
root@cpanel [/home]# cp -rp /home/useraccount1.bak/etc/userdomain.com /home/useraccount2/etc/userdomain.com chown -R useraccount2: /home/useraccount2/etc/userdomain.com
- Copy all email accounts to new account and set right permissions
cp -rp /home/useraccount1.bak/mail/userdomain.com /home/useraccount2/mail/userdomain.com chown useraccount2:mail /home/useraccount2/mail/userdomain.com chown -R useraccount2: /home/useraccount2/mail/userdomain.com/*
- Recreate alliases
cp /etc/valiases/userdomain.com.bak /etc/valiases/userdomain.com
That’s it. You should be able to see email accounts for userdomain.com in new cPanel account. All passwords should remain the same as before.