Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default How can I restore multiple accounts from cPanel backups?

    Hello,

    I have an incremental cPanel backup and I need to restore +20 accounts. How can I do that from shell or any easier way than going through WHM and restoring them one by one?

    Thanks.

  2. #2
    Member
    Join Date
    Jan 2011
    Posts
    505
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How can I restore multiple accounts from cPanel backups?

    Hello,

    To restore a full backup file, simply move the file (usually named as username.tar.gz or cpmove-username.tar.gz) to /home directory (or /usr/home, /web, /home2, /home3, /root, /usr directory if applicable). Then login to WHM (WebHost Manager), and click on Restore a Full Backup/cpmove file link under the Backup section. Enter the user name for the account to restore in the text field after “Enter the username for the account you wish to restore”. Finally click on Restore button and wait for the restoration process to complete.

    From shell :

    /scripts/restorepkg username

  3. #3
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default Re: How can I restore multiple accounts from cPanel backups?

    Thanks but as I stated it's an incremental backup. There are no .tar.gz files.

  4. #4
    Member
    Join Date
    Jan 2011
    Posts
    505
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How can I restore multiple accounts from cPanel backups?

    Hello,

    You just have to the tar the user backup directory in the form .tar.gz and need to copy it to /home partition.

    Below given command will help you to create the user backup directory in the format.

    $ tar -zcvf user.tar.gz user

  5. #5
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Default Re: How can I restore multiple accounts from cPanel backups?

    Quote Originally Posted by LinuxTechie View Post
    Hello,

    To restore a full backup file, simply move the file (usually named as username.tar.gz or cpmove-username.tar.gz) to /home directory (or /usr/home, /web, /home2, /home3, /root, /usr directory if applicable). Then login to WHM (WebHost Manager), and click on Restore a Full Backup/cpmove file link under the Backup section. Enter the user name for the account to restore in the text field after “Enter the username for the account you wish to restore”. Finally click on Restore button and wait for the restoration process to complete.

    From shell :

    /scripts/restorepkg username
    Sorry to bump this thread. If I have 100+ accounts then I have to enter user name every time for all users. Is there anyway to restore all accounts?

  6. #6
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb Re: How can I restore multiple accounts from cPanel backups?


  7. #7
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    1,346
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How can I restore multiple accounts from cPanel backups?

    Hello

    You can restore multiple backups by using the following option available in Web Host Manager:

    "WHM >> Backup >> Restore Multiple Backups"

    If you are attempting to restore incremental backups, ensure the "Incremental Backup" option is enabled via "WHM >> Backup >> Configure Backup".

    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  8. #8
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Default Re: How can I restore multiple accounts from cPanel backups?

    No one is understanding me.
    I did following
    1) Took remote backups of 50+ accounts from other server to my server.
    2) These backups were stored in a cpanel account and I moved all accounts to /home dir by using mv command
    3) No I go to Main >> Backup >> Restore a Full Backup/cpmove file and there were 50 accounts that can be restored.
    4) Through this method, I have to enter user name 50 times that is time consuming.
    5) Now my question is this that is there any shell command so that I can restore all these accounts from /home dir at once?

  9. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How can I restore multiple accounts from cPanel backups?

    Is there a reason you did not try the option Michael indicated:

    WHM >> Backup >> Restore Multiple Backups

    This would have allowed you to restore multiple backups rather than individually. The option you selected of "Restore a Full Backup/cpmove file" is not the same one he had noted.

    As for command line, you could do the following to restore multiple backups there.

    1. Create a list of all the usernames that are being restored called /root/acctlist. You could create this script by going to the old machine and doing this command:

    Code:
    cat /etc/trueuserdomains | cut -d: -d' ' -f2- > /root/acctlist
    This will create a file on the old machine /root/acctlist that you can copy to the new machine.

    2. On the new machine, you could then issue these commands after the new machine has /root/acctlist on it:

    Code:
    screen
    for i in `cat /root/acctlist` ;do /scripts/restorepkg $i ;done
    I have the command running in screen in case your SSH connection gets shut down somehow, since the screen session isn't dependent on your specific terminal working.

    If you don't have screen installed onto the new machine, you can install it using:

    Code:
    yum install screen
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  10. #10
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Default Re: How can I restore multiple accounts from cPanel backups?

    Quote Originally Posted by cPanelTristan View Post
    Is there a reason you did not try the option Michael indicated:
    I tried this option too but SSH timed out. Don't know what's the problem behind this?

  11. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How can I restore multiple accounts from cPanel backups?

    I don't understand why SSH would time out when this is a restore option and not a transfer option. When you are restoring backups that exist on the machine, it isn't using SSH.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  12. #12
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Default Re: How can I restore multiple accounts from cPanel backups?

    Quote Originally Posted by cPanelTristan View Post
    I don't understand why SSH would time out when this is a restore option and not a transfer option. When you are restoring backups that exist on the machine, it isn't using SSH.
    Seems that you did not read the above replies carefully. I also tried to Transfer accounts and got SSH error.

  13. #13
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: How can I restore multiple accounts from cPanel backups?

    I am not referring to your prior replies but to the one that was directly above my reply since we were referring to my post. As such, I was referring directly to the fact you have the backups on the machine and tried to restore them using Main >> Backup >> Restore a Full Backup/cpmove file option. I asked if you had tried the method Michael suggested for those backups you had on the machine of WHM >> Backup >> Restore Multiple Backups, which you quoted in that reply. Under that method, SSH is not used when the backups already exist on the machine.

    I am trying to assist you here in your request for what to run in command line if you have backups on the machine. I am uncertain where Transfers comes into play under any of the methods I discussed in my post other than trying to copy the /root/acctlist file itself from the old server using scp. If you cannot copy that file using scp to get it onto the new machine, you can always open the file and copy the contents, then paste them into a new file on the new machine.

    Please feel free to provide specific details on anything that does not work using the method I actually suggested.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Fixing mail permissions on Restore Multiple Backups freezing (11.30)
    By Smuxinho in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-01-2011, 06:47 AM
  2. Question About Restore restore multiple backups via ssh?
    By assassin85 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-13-2009, 08:33 AM
  3. Restore Multiple Backups - please help
    By zenid in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-20-2008, 03:34 PM
  4. 'Restore Backups' / 'Restore Multiple Backups' - No users listed!
    By mitu in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-31-2007, 04:08 AM
  5. Restore multiple backups
    By XBL in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-04-2004, 06:05 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube