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.

How to change a cPanel account domain name from Command Line?

Discussion in 'cPanel Developers' started by hybridRoot, Jul 3, 2015.

  1. hybridRoot

    hybridRoot Registered

    Joined:
    Jul 3, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lebanon
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm creating a script to backup a cPanel user account from serverX and restore it on ServerY.

    During the restoration process, I want to change the domain name from domain.com to domain.net, but I'm unable to find the command line that does that.

    Both servers are dedi servers and I have root privileges. Both of them have WHM/cPanel installed as well.

    So far what I have in the restoration process is:

    Code:
    #Restore account on serverY
    /scripts/restorepkg --force --ip=xxx.xxx.xxx.xxx /home/backupes/backup/cpmove-user.tar.gz
    
    #changing account domain name ???
    
    
    #Change password
    /scripts/chpass user passwd
    /scripts/ftpupdate
    
    Any help is appreciated.

    Thanks
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    There are no native features that will allow you to change the domain name during the restore process in the same way that you can change the username with the "--newuser" flag. Is there a specific reason this needs to happen before the restore? For instance, does the domain name exist on the destination server already? You could modify the account after it's been restored via the UI, but not during the restorepkg process itself.

    Thank you.
     
Loading...

Share This Page