Addon Domain -> Standalone Account

`Square

Registered
May 10, 2003
2
0
151
Hey guys, I know this has been answered numerous times but there isn't a step by step guide.

I have an addon domain under a resellers cPanel account and he wants to move it to a standalone account under him as a reseller.

I know I can copy the dns zone/drop the addon domain and move files across but what about email addresses and accounts with passwords?

If I copy the /home/user/mail/domain.tld to the new place will it also take the email accounts and they'll show under the new cPanel account with the correct password as before?

I can't believe there isn't a script for this.

any help would be appreicated.

Thanks,

Michael
 

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
Yes, once you backup the addon domain website files/databases, make a copy of the following directories

cp -p /home/previoususer/mail/addondomain.tld /root/addondomain.tld_mails -R
cp -p /home/previoususer/etc/addondomain.tld /root/addondomain.tld_passwords -R
Now, remove the addon domain, create a separate account for the add-on domain, restore the website files/databases. Once done, remove the default mail related directories of the new domain

rm -rf /home/newuser/mail/domainname.tld
rm -rf /home/newuser/etc/domainname.tld
and restore the previous backed up directories with these new names. For example:

cp -p /root/addondomain.tld_mails /home/newuser/mail/domainname.tld -R
cp -p /root/addondomain.tld_passwords /home/newuser/etc/addondomain.tld -R
this will restore the email accounts and their passwords of the add-on domain on the newly created domain.
 

`Square

Registered
May 10, 2003
2
0
151
Thanks for your reply.

Few more questions;

How can i backup the dns zone file? They have a few modifications and I don't want to lose them.

Also I'm the root owner of the vps and he is a reseller, how can i create the account but have him as the owner of it without the resellers password?

Thanks,

Michael
 

madaboutlinux

Well-Known Member
Jan 24, 2005
1,051
2
168
Earth
make a copy of the zone file

cp -p /var/named/addondomain.tld.db /root/
Once the account is re-created, overwrite the new zone file with the old one

cp -p /root/addondomain.tld.db /var/named/
and restart the named service

service named restart
Regarding the ownership, once the account is created from WHM as root, goto the "List Accounts" option. Search the new domain, scroll to the extreme right and you will see a "Owner" column from where you can change the ownership of the domain from "root" to the reseller user and he will be able to manage it from his Reseller WHM.