Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice