The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

change normal domain to addon domain?

Discussion in 'General Discussion' started by SoftDux, Oct 29, 2006.

  1. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Hi

    I have two accounts on my server (with email, databases, websites, etc), which I want to change from normal accounts, to add-on accounts for another domain.

    How do I do this?
     
  2. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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...
     
    #2 myusername, Nov 1, 2006
    Last edited: Nov 1, 2006
  3. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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.
     
  4. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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.
     
    #4 myusername, Nov 1, 2006
    Last edited: Nov 1, 2006
Loading...

Share This Page