The WHMCS database contains every client, invoice, transaction and ticket. Losing it would be a disaster for a hosting business. WHMCS can send a backup of its database every day during the cron run. Combined with your host's backups, this gives you a reliable recovery path.
Before you start
- WHMCS admin access and a working cron.
- A destination for backups: an SFTP or FTP server off the WHMCS machine, or your cPanel account's backup system.
Configure automatic backups
- Go to Configuration → System Settings → Database Backups.
- Choose and activate a method:
- Secure FTP / FTP – enter host, port, user, password and destination folder. SFTP (port 22) is strongly preferred.
- cPanel Backup – triggers a full cPanel account backup to a remote destination using your cPanel credentials or API token. This includes WHMCS files too.
- Email – sends the compressed database by email. Only suitable for small databases, and email is not a secure place for customer data.
- Click Test Connection where offered, then Save Changes.
Backups run during the daily automation. Check Utilities → Automation Status the next day for the result.
Add independent backups
Don't rely on one method. Good practice for a hosting business:
- WHMCS's own SFTP backup to a separate server or storage box.
- Your hosting provider's daily backups of the account (MdmHost uses JetBackup on cPanel hosting).
- A weekly manual export you store offline, especially before upgrades.
Make a manual backup
In cPanel, open phpMyAdmin, select the WHMCS database, click Export, choose Quick and SQL, and save the file. Over SSH:
mysqldump --single-transaction -u whmcs_user -p whmcs_db | gzip > whmcs-$(date +%F).sql.gzAlso copy configuration.php: it contains the $cc_encryption_hash, without which encrypted data (passwords, stored card references) in the database cannot be decrypted.
Important: keep a secure copy of configuration.php with every backup. A database restored without the matching encryption hash loses access to all encrypted fields.
Restore WHMCS from a backup
- Put WHMCS in maintenance mode: Configuration → System Settings → General Settings → Maintenance Mode.
- Create a fresh backup of the current (broken) state, just in case.
- In phpMyAdmin, drop all tables of the WHMCS database or create a new empty database.
- Import the backup SQL file.
- Ensure
configuration.phphas the matching database credentials and the original$cc_encryption_hash. - Log in to the admin area, check recent invoices and transactions, then disable maintenance mode.
Payments received between the backup and the restore must be re-entered from your gateway reports.
Troubleshooting
- FTP backup fails: wrong credentials, passive mode issues or the remote folder does not exist. Check the Activity Log for the error.
- Backup email never arrives: the attachment is too large for your mail server. Switch to SFTP.
- Import fails due to size: import via SSH with
mysqlinstead of phpMyAdmin.
