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.

One account two domains

Discussion in 'General Discussion' started by John Schmerold, Jan 30, 2015.

  1. John Schmerold

    John Schmerold Active Member

    Joined:
    Apr 21, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    We have a client with two domains, domain2.com is configured as an alias and has its own email addresses.

    The client had been hosting http://domain1.com with elsewhere WordPress hosting and wants to bring it home

    I am trying to figure out best way to do this. Cleanest long term solution is to create another account and move domain2 to the new account, If there is a way to do this I don't see how.

    I am looking for other ways to accomplish this task.

    Ideas?
     
  2. John Schmerold

    John Schmerold Active Member

    Joined:
    Apr 21, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    After hitting send, I found https://documentation.cpanel.net/display/PLD/Aliases
    Looks like I need to do following:
    1. backup account1: /scripts/pkgacct account1
    2. Remove domain2 alias from account1
    3. Create account2
    SSH into server for steps 3-6
    4. mv /home/account1/public_html /home/account2/public_html
    5. chown -R account2:account2 /home/account2/public_html
    6. mv /home/account1/mail/domain2 /home/account2/mail
    7. chown -R account2:account2 /home/account2/mail/domain2
    Back at cPanel
    8. Install Wordpress in account1

    Am I missing anything, will the email addresses & passwords transfer when I do this?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    There are a few caveats to those instructions:

    1. Verify the ownership of /home/account2/public_html itself before copying over the source account's public_html directory. Ownership is not always "user:user" for the public_html directory itself. Also, you would have to first remove the public_html directory from the new account and then copy it over via "mv /home/account1/public_html /home/account2/".

    2. You have to create the email accounts on the new account before copying over the mail directory.

    3. Run the following command after copying over the mail:

    Code:
    /scripts/mailperm $new-username
    Thank you.
     
  4. John Schmerold

    John Schmerold Active Member

    Joined:
    Apr 21, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    When I create the email accounts on the new account, is there a way to transfer passwords from old account to new account?
     
  5. John Schmerold

    John Schmerold Active Member

    Joined:
    Apr 21, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    Based on guidence from Eric Delorme, I copied following folders and modified their permissions:
    /home/account1/etc/domain2
    /home/account1/mail/domain2
    /home/account1/public_html

    This preserved email accounts.

    Thanks everyone for your help.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page