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.

Converting from cPanel subdomain to WHM account

Discussion in 'General Discussion' started by thoughtcat, Nov 9, 2014.

  1. thoughtcat

    thoughtcat Member

    Joined:
    Nov 9, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I recently got a VPS with WHM. My root account is mysite.com. I needed the subdomain hello.mysite.com and didn't really know how to use WHM at the time, so instead of creating a new account in WHM, I did what I was used to doing which was to create hello.mysite.com as a subdomain within my mysite.com cPanel. I installed a Drupal site in the directory public_html/hello. Now however I want to take the site out of the general public_html directory of mysite.com and create its own account in WHM. If I try creating the new subdomain in WHM I get 'The domain “hello.mysite.com” already exists in the Apache configuration.' So I guess I have to remove the existing subdomain from cPanel before I can create the WHM account of the same name. What's the easiest way to convert the original subdomain into a new WHM account without losing the site that is currently living at hello.mysite.com?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can delete the subdomain without removing the contents of it's document root. Simply delete the subdomain, create the new account, and then manually copy the data over to it's new location (ensure you update ownership values after copying the data). Also, ensure the hostname of your server does not match the subdomain.

    Thank you.
     
  3. thoughtcat

    thoughtcat Member

    Joined:
    Nov 9, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Great thanks. I also asked my hosting provider, who recommended creating the new account with a different subdomain name, transferring the files over, then removing the old subdomain and renaming the account to the original name.
     
  4. thoughtcat

    thoughtcat Member

    Joined:
    Nov 9, 2014
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael, quick question, I have removed the subdomain in cPanel and all the site code is still in place as you said. Am I still able to visit the site in the meantime e.g. via an IP address? All my subdomains/sites share an IP address, so I'm not sure if this can be done.
     
  5. danrussell

    danrussell Well-Known Member

    Joined:
    Nov 5, 2014
    Messages:
    60
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, you can visit the site using the primary domain i.e. mysite.com/hello or using IP as

    http://<ipaddress>/~cpuser/hello

    Thanks.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can manually edit the hosts file on your workstation so that the subdomain loads in the meantime:

    hosts (file) - Wikipedia, the free encyclopedia

    Just remember to revert the change when it's no longer required.

    Thank you.
     
Loading...

Share This Page