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.

Restore backup via SSH Multiple accounts

Discussion in 'General Discussion' started by jegavelan, Oct 16, 2009.

  1. jegavelan

    jegavelan Member

    Joined:
    Dec 19, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    How to restore the backup from the backup via ssh for multiple accounts

    Suppose i have 100 accounts how i can restore the cpanel of those accounts via the ssh without running the /scripts/restorepkg username for each account
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    You must run the "/scripts/restorepkg" command to restore from a full account backup; to avoid having to do this manually for each account backup you may want to script the shell command so that it runs "/scripts/restorepkg" in a loop from a list of users that you provide.

    Here is an example, assuming the list of users is stored in a text file at "/root/list_of_users.txt":
    Code:
    # for x in $(cat /root/list_of_users.txt); do /scripts/restorepkg /home/cpbackup-$x.tar.gz; done;
    Alternatively, if the filename of the full backups varied, you could store a list of the full paths to each backup in a text file, such as a text file at "/root/list_of_backups.txt" and then the command could be altered as follows:
    Code:
    # for x in $(cat /root/list_of_backups.txt); do echo /scripts/restorepkg $x; done;
     
  3. raonaveed

    raonaveed Member

    Joined:
    Nov 30, 2009
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    How can i take backup from any other server where i have only reseller access not the root or you can say only cpanel account access so in that case how i can take remote backup on that server and fetch on my server where i have root login using SSH command or api calls?
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    As I understand you said root access is available only on the destination server, where I believe you're wanting to transfer to or restore the account on via a full cPanel account backup.

    With root access only on the destination server and not on the source/original server, you may use WHM via the following menu path:
    WHM: Main >> Transfers >> Copy an Account from Another Server with Account Password

    With or without root access on either machine, and specifically, with only access to the source/original server via the cPanel account username and password, you may login to cPanel and then generate a full cPanel account backup via either of the following two menu paths:
    cPanel: Main >> Files >> Backups
    cPanel: Main >> Files >> Backup Wizard

    When generating the cPanel full account backup, you will have the option to modify the desired e-mail contact address that is used for notification upon completion; you will also have the option to select the desired destination of your full backup, including in the cPanel user's home directory on that same server, or a remote destination where the full backup will be copied into an FTP account you provide or copied to a remote server using SSH/SCP access that you provide. Depending on how much data is involved and how long it takes the server to complete the requested task there may be a significant period of time where you must wait while the backup is being created and, optionally, subsequently copied via FTP or SCP/SSH access. Upon completion you should receive an e-mail at the contact address that was provided when requesting the full backup be generated via cPanel.

    If the domain name of the cPanel account no longer resolves to the original/source server you may access that server directly by IP address or hostname, such as one of the following examples; in these examples simply replace "server" with either the server IP address or the server hostname, whichever is known:
    Code:
    http://server:2082/
    https://server:2083/
     
Loading...

Share This Page