change normal domain to addon domain?

myusername

Well-Known Member
PartnerNOC
Mar 6, 2003
693
1
168
chown -R us.*yourbase*
cPanel Access Level
DataCenter Provider
Twitter
*** use at your own risk ***

One way would be to:

Code:
cd /home/userdir
cp -af public_html /home/newuser/public_html/userdir
cd /home
mv userdir userdirbackup

cd /home/newuser/public_html chown -R newuser.newuser userdir (if you run php as a cgi)
or
cd /home/newuser/public_html chown -R newuser.nobody userdir (if you run php as a module)
Where userdir is the existing site, and newuserdir is the master account where you want the old main site to become an addon.

Then delete the old user from WHM.
Then go into cPanel for newuser and create the addon domain using userdir as the subdirectory.

If something does wrong you can restore the old account from backup OR recreate in in WHM then

Code:
cd /home
mv userdirbackup userdir
if all works well for you once you create the addon domain you can remove the backup from the home directory.

But this method probably brings over a lot of unecesarry files so...
 
Last edited:

SoftDux

Well-Known Member
May 27, 2006
1,023
5
168
Johannesburg, South Africa
cPanel Access Level
Root Administrator
What you say might work. I guess the only problem would come in with the emails (and all relevant configs, etc), since these are "controled" by the main account.

At this stage we might change the whole setup, so this might not be needed, seeing that it' might be more of a headache than anything else.
 

myusername

Well-Known Member
PartnerNOC
Mar 6, 2003
693
1
168
chown -R us.*yourbase*
cPanel Access Level
DataCenter Provider
Twitter
Yeah thats why I said the unnecesarry files bit. I changed the above to deal with public_html only. :)

Sometimes you'll notice after creating the addon domains of a deleted site the mailboxes magically reappear. no idea why, and it doesn't always happen.
 
Last edited: