When system backups are enabled, your server stores backup files in the local backup directory (/backup
) by default. Optionally, system backup files can be stored in an additional destination. This can be configured manually, through an API call, or using WHM’s Backup Configuration interface (WHM » Home » Backup » Backup Configuration).
The /usr/local/cpanel/bin/backup
script is responsible for uploading .tar
files containing all system backup data to each configured destination. System backup files are only sent to destinations where the upload_system_backup
value in their configuration file is set to 1
(enabled).
Note:
- It is important to note that cPanel & WHM does not provide a built-in interface for restoring system backup files. Manual restoration is required to recover content from these backup files.
- Additional destination configuration files utilize YAML format, structured as a simple associative array.
- For enhanced security, ensure the destination server resides within your secure network. If backups are not transferred to a server on your secure network, it is crucial to use a secure method such as SFTP, Amazon S3™, or WebDAV with SSL.
How to Enable System Backup File Saves
To enable system backup file saves, you can perform one of the following actions:
- In WHM’s Backup Configuration interface (WHM » Home » Backup » Backup Configuration), navigate to the Backup Settings tab and select the Back up System Files checkbox.
- Utilize the WHM API 1
backup_config_set
function, setting thebackupfiles
value to1
.
System Backup Files and Directories
Important:
DNSSEC databases are included in the system files backup. However, the DNSSEC database can become corrupted due to conditions such as Out Of Memory (OOM), a full disk, or inadvertent actions by the system administrator.
While restoration from system backup files is possible, if system files are not backed up, the system administrator will need to perform the following steps:
- Rebuild the
PDNS.db
file from scratch.- Regenerate DNSSEC keys for each affected domain.
- Instruct users to register the new DNSSEC keys with their domain registrar.
cPanel & WHM backs up the following essential files and directories:
Files
/etc/exim.conf
/etc/exim.conf.local
/etc/exim.conf.localopts
/etc/named.conf
/etc/named.conf
/etc/proftpd.conf
/etc/pure-ftpd.conf
/etc/localdomains
/etc/apache2/conf/httpd.conf
/etc/group
/etc/shadow
/etc/passwd
/etc/fstab
/etc/ips
/etc/ips.remotemail
/etc/ips.remotedns
/etc/manualmx
/etc/reservedips
/etc/reservedipreasons
/etc/wwwacct.conf
/etc/remotedomains
/etc/rndc.conf
/etc/secondarymx
/etc/my.cnf
/root/.my.cnf
/etc/apache2/conf/httpd.conf
Directories
/etc/cpanel
/etc/named
/etc/valiases
/etc/proftpd
/etc/vdomainaliases
/etc/ssl
/etc/vfilters
/usr/local/cpanel/3rdparty/mailman
/var/lib/rpm
/var/named
/var/cpanel
/var/spool/cron
/var/cpanel/bandwidth
/var/cpanel/ssl
/var/lib/mysql
/etc/pki/tls/certs/
Custom Files
To include custom files or directories in system backups, create a new file or directory within the /var/cpanel/backups/extras
directory (e.g., /var/cpanel/backups/extras/etc
). Within this new file, specify the absolute path to any files you wish to back up (e.g., /etc/example.conf
).
Note: The system administrator has the option to modify the
/etc/my.cnf
file to change the MySQL® data directory location. In such cases, the system will back up the directory at its updated location.
How to Configure an Additional Destination to Receive System Backups
To set up an additional destination for receiving system backups, follow one of these procedures:
Interface Method
Navigate to WHM’s Backup Configuration interface, select the Additional Destinations tab, and input the necessary information for the additional destination.
Important: Make certain that you select the Transfer System Backups to this Destination checkbox.
Manual Configuration Method
To manually modify the configuration file of an additional destination, perform the following steps:
- Locate the appropriate configuration file within the
/var/cpanel/backups
directory.
- Each destination is associated with its own distinct configuration file.
- File names typically include the destination name, a User ID (UID) label, and a UID character string. For example:
myftp_UID_Z6rdq0rko2Z28uWTIN33SeCY.backup_destination
Note: This UID sequence helps prevent conflicts with previously established destinations that may share the same name.
- Open the file using a text editor and insert the following line:
upload_system_backup: 1
- Save the changes to the file.
API Call Method
To use API calls to modify the configuration file of an additional destination, perform the following steps:
- Invoke the WHM API 1
backup_destination_list
function to obtain the ID of the desired additional destination for system backups. - Execute the WHM API 1
backup_destination_set
function, including the following parameters and values:id
— The ID that thebackup_destination_list
function returned.upload_system_backup
—1
Log Files
The system records backup initialization events in the /usr/local/cpanel/logs/error_log
file. This error_log
file references individual account package logs. For comprehensive details, please refer to our cPanel & WHM Log Files documentation.