WHM/cPanel offers multiple ways to make and manage backups. This article will explain how you can schedule automated backups of a whole server through WHM. If you are looking for instructions to create a backup of a single website through the cPanel user interface, without need of root access to WHM, please visit this related article:
Creating a One-Time Website Backup with cPanel
Backup Configuration
You will first need to navigate to the Backup Configuration page. Depending on your preferred method, there are a couple different ways you can get there:
- Classic View - Main Home Screen
- If you prefer using the “Classic View” of the WHM home screen, you can start by clicking Backup on the home screen.
- Now, click Backup Configuration from the available options.
- If you prefer using the “Classic View” of the WHM home screen, you can start by clicking Backup on the home screen.
- Left Sidebar
- If you prefer using the “Default View” of the WHM home screen, or if you prefer to use the left sidebar for navigation, you can do one of the following
- Click the Backup section header in the left sidebar
and then choosing Backup Configuration from the list of available options. - Click on the arrow beside the Backup section header to expand it, and then choose Backup Configuration from the list of available options.
- Click the Backup section header in the left sidebar
- If you prefer using the “Default View” of the WHM home screen, or if you prefer to use the left sidebar for navigation, you can do one of the following
- Searching
- From the search box in the top left of WHM, type the word backup and select Backup Configuration from the available results.
- From the search box in the top left of WHM, type the word backup and select Backup Configuration from the available results.
Backup Settings
From the backup and configuration page you can manage all of the settings associated with your scheduled backups including what data is backed up when it is run and where it is stored.
Backup Status
Enable Backup: Selecting this check box activates the scheduled backup process.
Warning: If this box is not checked, any configured backup schedules specified below this option are disabled and will not run.
Global Settings
Backup Type
Select what type of backup you wish to be taken. For most users, the default choice of Compressed is recommended. It takes more time to complete, but the resulting backup uses less disk space than the uncompressed option, and is easier to restore from than an incremental backup.
Note: As a general guideline, we recommend having unused space available equivalent to 2.5 to 3 times the amount of data that will be compressed. So if your content consumes 10 GB, it is practical planning to ensure you maintain 25G to 30G of free space available to allow for backup creation.
Check the Available disk space
This option tells the server to check how much available space is remaining before attempting a backup. It is highly recommended that you select this option and determine how much space you will need to create a backup. If the server runs out of free disk space, critical services may no longer function until you create more available space. In short, running out of disk space can shut down your server. The system defaults to 5% as a minimum however you can change this to total MB if you prefer.
Maximum Destination Backup Timeout
This feature allows you to set the amount of time (in seconds) the system will spend attempting to connect and write to a remote location. The default is set to 7200 seconds (2 hours) and is a safe to leave as is. If you find that the backup connection to a remote location is slow and therefore failing due to time out errors this setting should be changed.
Maximum Backup Restoration Timeout
This setting dictates how much time the server has to restore any given backup. The default of 21,600 seconds (6 hours) is safe to leave as is. If you find that your backup restoration is timing out this value can be adjusted.
Scheduling and Retention
Scheduling and retention determines how often backups are taken and how long they are kept. Backups can be scheduled to be taken on a daily, weekly and monthly basis by selecting the corresponding check boxes. It is important to ensure you have enough disk space to hold the backups you choose to schedule and retain.
Retention Behavior
When determining how much space you need to to retain backup copies it is important that you add one additional copy to your calculations. The system will not delete the oldest copy you have retained until after the newest copy is successfully written. So if you plan to keep the last 3 copies for retention purposes you need to have the space to store 4.
Failed Backups Without Strict Retention
When a system backup is partially completed (fails), the system will not delete the oldest backups, and it will continue to retain the oldest backups until a successful backup is completed. This is only the case if Strict Retention rules are turned off This procedure ensures that the system retains at least one retained complete backup.
In the following scenario the system is set to taks and retain 3 backup’s.
After 3 successful backups # 4 fails.
#5 fails as well.
#6 backs up successfully insuring one good copy and the older backups are deleted.
Strictly enforce retention, regardless of backup success: By selecting this feature the system, regardless of backup success, will only retain the amount you have chosen. (Space saving) If you select this option, the system will always retain only the desired number of backups with at least one complete backup.
In the following scenario the system is set to take and retain 3 backups with Strict enforcement enabled.
The initial 3 backups are created and retained successfully.
#4 Backup fails.
#5 Fails
#6 fails, Backup #3 is retained, and failed #4 is deleted to make room for failed #6.
#7 is successful, and #3 is deleted as you have one good backup copy in #7.
Files
The file section allows you to select what data you want backed up.
Backup Accounts
Select the Backup Accounts checkbox to create backups for cPanel accounts. Click Select Users to select individual cPanel accounts to back up. This tab opens the Backup User Selection interface and will redirect you to that page where you can select or exclude entire cPanel accounts.
Backup Suspended Accounts: Select Enable to backup suspended accounts.
If you do not enable this option, your server will not backup suspended accounts regardless of the setting in the Backup User Selection interface.
Backup Access Logs: Select Enable to backup your server's access logs and the /usr/local/cpanel/domlogs file.
Backup Bandwidth Data: Select Enable to backup your server's bandwidth data.
Use Local DNS: Select the method to backup the Domain Name System (DNS) information:
- Disable — The system backs up DNS information from the DNS cluster.
- Enable — The system backs up DNS information from the server that hosts the domain.
Backup System Files
When enables the utility will backup your server's system files. We strongly recommend you enable this setting.
Note: When backing up files, the old adage holds true: “It’s always better to be safe than sorry”. We typically recommend that you backup as much data as possible.
Databases
You will need to select one of the following options for the Backup SQL Databases setting, to determine how to backup SQL databases:
Per Account Only: Only backup the databases for each account. This setting uses the mysqldump utility.
Entire MySQL Directory: Backup all of the databases on the server. This backs up the entire /var/lib/mysql/ directory.
Per Account and Entire MySQL Directory: Perform a comprehensive backup that copies all of the databases for each individual account, as well as all of the databases on the server.
Configure the Backup Directory
Cozaq recommends that you maintain backups both locally (for speed of restoration) and remotely (removing the server as a single point of failure) when configuring a backup and restoration solution. cPanel & WHM strongly recommends that you work with a qualified system administrator to manage this custom backup path and avoid potential risks. Please reach out ot your account manager to discuss getting the system administration team involved in creating the appropriate remote backup solution.
Default Backup Directory
To change the default backup directory, enter the absolute path to the desired directory location.
Note: By default, the system saves backup files locally, to the /backup/ directory. For non-experienced users this setting should not be changed.
Retain backups in the default backup directory
This box allows you to keep a copy of the backup locally on your server in the /backup directory for each account when you are saving your backup to a remote location. If you do not select this setting, your server deletes account backup files from the /backup/ directory only after the a copy is transferred to one remote location successfully. If you are transferring to multiple locations and one is successful and one fails the back upp will be deleted locally.
cPanel & WHM strongly recommends that you work with a qualified system administrator to manage this custom backup path and avoid potential risks. Please reach out ot your account manager to discuss getting the system administration team involved in creating the appropriate remote backup solution.
Mount Backup Drive as Needed
WHM / cPanel will automatically mount a backup drive at the time of any scheduled backup. Again, we recommend getting a qualified System administrator involved when enabling this feature. They will need to create a backup volume for you and change the file path for backups to write to. Please reach out ot your Account Manager for assistance with setting this feature up.
Additional Destinations
WHM / cPanel allows for the configuration of additional destination points to store your scheduled backups. We always recommend that users take advantage of this feature of the server but do so with caution and advice, Because additional destinations are not written locally to the server several factors can cause issue with writing to them and recovering from them.
The speed of the remote destination connection and the amount of data being written should be considered when setting up a remote destination for your back up data. Each additional destination may increase the amount of time that the backup process requires. If the process runs too long, it may interfere with the next backup process.
Our system administration team would be happy to help you determine the best way to go about setting up additional destinations with you. As part of our backup and recovery service Cozaq offers backups that are within the same datacenter on independent hardware. These backups protect from hardware failures and VM corruption with faster transfer and recovery speeds than cloud based remote backups. We can assist with cloud based remote backups where additional protection is required.
If you choose to setup your own additional destination you will need to navigate to the Additional Destination tab at the top of the Backup Configuration page.
From there you can select and configure multiple third party additional destination types.