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 Restore questions

Discussion in 'Data Protection' started by jethrodesign, Jul 27, 2012.

  1. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi, this is a bit of a follow-up to a thread about proper backup settings. I just wanted a bit of clarification on the settings and process of restoring a backup made using WHM. Unfortunately, the documentation is quite limited here.

    So in selecting 'Restore Backups' in WHM, after selecting the account(s):

    1) What exactly would 'Recreate Account' do and in what circumstances would we generally want to use this? All of our accounts exist on one VPS this install of WHM/CPANEL is running on.

    2) Does 'Restore Mail Config' only restore the email accounts and any forwarding? How is the actual stored email handled in a backup/restore? (most of our clients only use webmail and do not backup stored email off-server).

    3) 'Restore MySQL Databases' is an option. What if that's all you wanted to restore? A lot of times, with data-driven sites, this may be the only thing that gets corrupted or damaged.

    4) If restoring MySQL Databases, in what instances would you NOT want to also use 'Overwrite Same Named MySQL Databases'?


    I'm almost understanding the entire backup/restore solution that WHM uses. Hopefully the documentation can be updated at some point to be a bit more descriptive, but until then maybe this thread can help others like me.

    Thanks!
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    Recreate Account would recreate the account if it didn't exist. You would use recreate account when you are wanting to restore the contents of the user and /home/username directory. If the user does still exist, recreate account will not work.

    Restore Mail Config would restore email accounts, their contents and any forwarders or aliases. I tested by moving the following:

    /home/username/mail
    /home/username/etc
    /etc/valiases/domain.com
    /etc/vfilters/domain.com

    All were recreated when running the restore.

    There isn't currently an option to only restore the MySQL databases, since even if you only check that option other areas are restored in the restore process such as public_html, DNS zone files, Apache entries, etc.

    If that's what you wanted, you could navigate to /backup/cpbackup/daily|weekly|monthly/username/mysql location (where you'd select daily, weekly or monthly, and select username for the username, then locate the .sql file in question and restore it in command line:

    Code:
    mysql dbname < dbname.sql
    Please replace dbname with the full name of the database.

    Of note, if you are using compressed files, you'll have to extract the compressed file for the user first.

    The only time I could think that you wouldn't want to overwrite them is if you copied backups from another server to a new server and are restoring them on the new server. It would take longer to perform overwrite operations, which wouldn't be needed because it would be a new server without any of the accounts already existing on it. If the account exists, you would always want to overwrite the existing databases.

    Thanks!
     
  3. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    OK, thanks for all the clarification! That makes a bit more sense now.

    Hmm, so it DOES restore the mail contents? People would get all their stored email up to the backup date??

    So what if we wanted to restore the main site files and/or MYSQL database ONLY, and not revert their email back a few days/weeks??? Does leaving that unchecked not touch ANYTHING in regards to their email?

    Thanks. Dealing with clients' email is such a massively important and sensitive issue, we need to be completely certain what would happen so we wouldn't overwrite or lose any important communications for them!
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    It does restore the mail contents, folders and all. They would get their stored mail up to the backup date.

    If you don't select the mail configuration option, you'll still have the mail restored but not the valiases and vfilters and other mail settings. I tested it without the option checked to see if /home/username/etc and /home/username/mail were restored and they were.

    Next, I created files that didn't exist in the backup in the /home/username/mail/domain.com/emailuser/cur folder for one of my accounts, then I restored the account. The mail files I added were not removed. This means we are only adding files that aren't in the folder.

    Finally, I moved contents that were in the backup out of /home/username/mail/domain.com/emailuser/cur folder and the contents were restored on account restore. These were all without mail configuration option selected.

    The backup restores the emails that aren't on the account.

    Thanks!
     
  5. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    That's very interesting. So from what you can tell, any email received AFTER a backup was made would not be deleted when the backup was restored? It would not force the directory to match what is in the backup??

    I guess I was assuming the cPanel backups would be a bit more straight-ahead. But if it actually can handle more advanced backup features like this, that's definitely good to know!
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I've tested it and it doesn't remove the contents currently in the directory when you are using the cpbackup files and daily, weekly or monthly restore for an account in WHM > Backup > Restore Backup area.
     
  7. fcenteno

    fcenteno Registered

    Joined:
    Apr 3, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,
    Can help me?
    I have move the folder mail to the new account in other isp but any email is restored. I have create all email account again and I have upload the mail folder to the cpanel account, but again any data is restored. Help me please
    Thanks
     
Loading...

Share This Page