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.

Correct method to change domain account's /home/username path to existing username ?

Discussion in 'General Discussion' started by eva2000, Dec 18, 2010.

  1. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
    Not sure what is the correct method of doing this so any help would be appreciated.

    2 domains
    • domain.com with /home/domcom
    • domain.net with /home/domnet

    now both sites have different set of files in them, but want to change domain.com to using /home/domnet path files. Changing username via modify account won't help as it says domnet already exists.

    Any what's correct method to do this ?
     
  2. aapkapratik

    aapkapratik Member

    Joined:
    Oct 26, 2009
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Re: Correct method to change domain account's /home/username path to existing usernam

    Hello,


    If you just wish to show the data at /home/domnet when accessed http://www.domain.com/ through webbrowser and vice versa , just interchange the DocumentRoot for both domains in
    "/etc/httpd/conf/httpd.conf"
    eg :
    Same should be done for "domain.net" change its DocumentRoot to "/home/domcom".

    Note : Here we have just asked apache server to pick the files from the new location when the URL is requested, so the username and password as well as access rights for both users account will remain the same, as ideally user domcom will not be having access to "/home/domnet"

    If you want to avoid this and do hardship once rather then keep remembering such settings in future.I'll suggest you to please change one of your account's username to any dummy username via
    modify account in WHM

    Suppose if we change the username of account "domain.com" to test.

    Now generate full backup of both the accounts.

    For this Login to the server via SSH with root privileges and use the script

    This will generate the backup of both accounts in tar.gz formate.

    Now Terminate the account "domain.com" from "Terminate an Account" in WHM.

    Once done first change the username of the account "domain.net" to domcom.

    Now restore the account "domain.com" using the script
    Remember we've changed the username of this account to test.

    Now "domain.com" will be having username test, change it to domnet and you are done.
     
  3. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: Correct method to change domain account's /home/username path to existing usernam

    Thanks for that forgot about pkgacct feature. Sites are >30GB in size so could take a while.

    I was also thinking, couldn't you just change the account's primary domain name ?

    so domain.net modify a/c change primary domain name to domain.com ? would need to change domain.com primary domain name to something other than domain.com right ?
     
    #3 eva2000, Dec 18, 2010
    Last edited: Dec 18, 2010
  4. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Re: Correct method to change domain account's /home/username path to existing usernam

    Yes, renaming domnet account's main domain is the better option. Changing VirtualHosts will not last a single upcp and may cause Apache uid/gid mismatch error if not handled properly.
    I would suggest you first rename domain.com to a temporary name like domain_bkp.com and then rename domain.net to domain.com as cPanel does not allow renaming a domain name if it already exists under another account for obvious reasons.

     
Loading...

Share This Page