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.

WHM Backup Questions

Discussion in 'Data Protection' started by nootkan, Apr 22, 2016.

  1. nootkan

    nootkan Well-Known Member

    Joined:
    Oct 25, 2006
    Messages:
    129
    Likes Received:
    2
    Trophy Points:
    18
    I had a hard drive start to fail on my server and had my data center replace it. Before doing so I forgot to back up all my WHM settings among a few others. Luckily I get to have access to my original drive for seven days before it is removed.

    I read through this documentation:
    Back Up, Restore, or Transfer Configurations - Documentation - cPanel Documentation

    I was able to backup my WHM config and WHM Tweek Settings just fine. But when I tried to restore the files nothing happened not even a notification saying it failed.

    So my question is what part of this line should be replaced with my backup tar file?
    /usr/local/cpanel/bin/cpconftool --configurations=cpanel::system::whmconf --restore=/home/whm-config-backup-cpanel__system__whmconf-11.55.0.9999-1454090817.tar.gz --preresore_backup

    I cd' to the root directory and ran this:
    /usr/local/cpanel/bin/cpconftool --configurations=cpanel::system::whmconf --restore=/home/whm-config-backup-all-1.1-1461360975.tar.gz
    --preresore_backup

    That is the name of the file that was backed up.

    Update: Okay I dropped the --preresore_backup and it worked however it moved it into the /home/ directory and when I checked the WHM Tweak Settings they were still the default.
     
    #1 nootkan, Apr 22, 2016
    Last edited: Apr 22, 2016
  2. Patrick Heinz

    Patrick Heinz Active Member

    Joined:
    Mar 14, 2015
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Brasil
    cPanel Access Level:
    Root Administrator
    Twitter:
    It doesn't matter which directory you are running this command.
    What do matter is the --restore path. It show point to previously backup in your server (or your drive in case you not copied that file to server)
     
  3. nootkan

    nootkan Well-Known Member

    Joined:
    Oct 25, 2006
    Messages:
    129
    Likes Received:
    2
    Trophy Points:
    18
    Thank you for your reply, however I'm not sure I understand what you're trying to tell me. I want restore the WHM config file which is the tar.gz file.

    The way I understand the script is
    /usr/local/cpanel/bin/cpconftool --configurations=cpanel::system::whmconf --restore=/home/whm-config-backup-all-1.1-1461360975.tar.gz --this part defines the file to restore, right?
    --preresore_backup --this part is supposed to be where you want the file to be restored to, right?

    Also should --preresore_backup actually be --prerestore_backup? I just copied the text from the original post which could be a "typeO"

    So I believe this is what you're trying to tell me and if so, how do I know where the WHM file is supposed to go to? In other words, where is it located on the server so I can get the backup to the right path? Thanks.
     
  4. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    Tweak Settings are located in /var/cpanel/cpanel.config, you can transfer it manually and get rid of these hassle.

    Hope that helps :)
     
    nootkan likes this.
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Could you verify how you are accessing the the original drive to generate the configuration file backups? Also, which version of cPanel was installed on that system? The documentation you have linked to is for cPanel version 56. The documentation for cPanel version 54 is found at:

    The cpconftool Script - Version 54 Documention - cPanel Documentation

    Thank you.
     
  6. nootkan

    nootkan Well-Known Member

    Joined:
    Oct 25, 2006
    Messages:
    129
    Likes Received:
    2
    Trophy Points:
    18
    Modserv, thanks for that. I was actually looking for all the WHM settings and not just the Tweak Settings but I'll copy those over too.
     
    ModServ likes this.
  7. nootkan

    nootkan Well-Known Member

    Joined:
    Oct 25, 2006
    Messages:
    129
    Likes Received:
    2
    Trophy Points:
    18
    Michael. my data center mounted the old drive on the server so I could copy over the config files and others that I forgot to backup. I've been using sftp mostly but the occasional ssh command also to copy over the files. I'm not sure what cPanel version was installed on the old drive, I can only assume it was a version before the one that is installed now because of the new drive and OS etc.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,698
    Likes Received:
    657
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The /usr/local/cpanel/bin/cpconftool script is designed to be ran on an active system to generate the backup configuration files, as opposed to packaging configuration files from a mounted drive. Thus, you would have to manually copy over the configuration data from the files available on the mounted drive. Is there any particular configuration data you are having trouble copying over or replicating?

    Thank you.
     
Loading...

Share This Page