Skip to content

cPanel backup configuration — the WHM toggles that determine whether a restore actually works

cPanel's built-in backup tooling is fine if configured deliberately. Default settings produce backups that look complete and fail on restore. A short configuration runbook.

A WHM server has been running cPanel’s nightly backup to a remote destination for months. The first time a customer needs a restore, the team discovers the backup is missing MySQL data, the retention only goes back 7 days, and the remote destination is full. cPanel’s backup system is configurable enough to do this right; the default configuration is conservative in ways that surprise operators. The fix is a deliberate pass through Backup Configuration and a test restore.

What’s happening

WHM Backup Configuration (WHM > Backup > Backup Configuration) controls: what to back up (home, MySQL, system files, configuration), retention (how many days to keep), destination (local, FTP, SFTP, S3, rsync, Google Drive), schedule (daily, weekly, monthly), and exclusions. The default settings often skip MySQL on the assumption it’ll be picked up elsewhere, keep only 7 days of retention, and use a local destination that fills before anyone notices. Each toggle is small; collectively they determine whether your backups are real.

How to verify

Read the current backup configuration:

whmapi1 backup_config_get
ls -la /backup/
cat /etc/cpbackup.conf
whmapi1 backup_destination_list
tail -100 /usr/local/cpanel/logs/cpbackup/cpbackup.log

The config_get output shows every backup-related setting. The /backup/ directory shows what’s currently stored locally; if you’ve configured remote, this should still have a recent local pass before transfer.

The fix

The configuration items that matter:

  1. Enable MySQL backups separately: the “Backup Databases” option must be set to “Per Account Only” or “Per Account and Entire MySQL Directory”. Without this, the cpmove archives are missing the database content.
  2. Set retention to match your RPO: 7 daily, 4 weekly, 3 monthly is a reasonable starting point. For compliance-heavy workloads, extend monthly retention. The BACKUPRETAIN (daily), BACKUPWEEKLYRETENTION, BACKUPMONTHLYRETENTION values control these.
  3. Use a remote destination, never local-only: configure whmapi1 backup_destination_add for an SFTP, S3, or rsync target. The local /backup/ is a working directory; the remote is the actual backup. Verify with backup_destination_validate.
  4. Exclude what you don’t need: cPanel can exclude specific paths from per-account backups (large media you handle separately, cache directories). Configured in /etc/cpbackup.conf or the WHM UI.
  5. Schedule the backup outside peak hours: the default 1 AM is fine for most environments; cPanel takes a global lock for the duration. Confirm the lock doesn’t overlap your highest-load window.
  6. Test a restore quarterly: pick a non-critical account, restore from yesterday’s backup to a non-production server, run the test, document the time. If you can’t restore the smallest account in less than an hour, the backup isn’t operationally usable.

Backups are exactly the kind of infrastructure that looks fine until you need it. Stack Harbor’s cPanel server management practice runs the configuration audit, the destination validation, and the quarterly restore drill so the answer to “can we restore” is always tested, not assumed.