Automatic Backups

From WHMCS Documentation

Redirect page

Redirect to:

WHMCS can automatically backup your database and upload to a SFTP/FTP location and/or email it to a designated email address.

From WHMCS 7.3, it is also possible to request a full cPanel backup for a specific user as part of the automatic backup process.

Enabling Automatic Backups

All backup configuration is completed in Setup > Other > Database Backups.

The available options are SFTP/FTP backup, Email backup and full cPanel Account backup.

Testing Connection

The SFTP/FTP and cPanel Backup options require a connection test being successful before activation. A connection test ensures the details are valid and the WHMCS installation can connect to the server. Any connection issue allows a resolution before a backup attempt occurs meaning less chance of a failed connection.

SFTP/FTP Backup

This backup will place the WHMCS generated zipped sql file on the specified remote server.

Checking the "Use Secure FTP/SFTP (Recommended)" box will ensure the backup upload is completed using an SFTP connection.

FTP Destination

This value should be relative to the login folder for the FTP/SFTP account being used. No initial slash should be used, for example, if upon logging in using those FTP details the folder is /home/user/ and the backup should be in /home/user/backups, then enter backups/ as the FTP Destination. If the login folder is where the backup file is to be uploaded, leave this field empty.

Why not create a separate FTP account jailed to a certain directory?

cPanel Backup

The cPanel Backup option uses the Full Backup feature of WHM/cPanel's backup wizard.

cPanel Username

The cPanel Username is the name of the account to be backed up.

Backup Destination

  • Home Directory — Select this option to save the backup file to the server.
  • Remote FTP Server — Select this option to use FTP to store the backup file on a remote server.
  • Remote FTP Server (Passive Mode Transfer) — Select this option to use passive FTP to store the backup file on a remote server.
  • SCP — Select this option to use SCP to store the backup file on a remote server.
Using Home Directory will generate the backup file in the home directory of the cPanel user. This will count against any disk space limits and should be manually moved to a better location after completion.

The System Cron will only request the start of a full backup. Completion, and relocation of the backup occurs within cPanel and will not be notified though WHMCS.

Troubleshooting

A number of errors may appear in the Activity Log when a backup is being completed by the WHMCS Cron.

Table 'xxx' doesn't exist when using LOCK TABLES

Indicates the named table 'xxx' is crashed or corrupted. Running a MySQL repair operation can resolve this. Tables can be repaired via the MySQL Databases page within cPanel or using a tool such as phpmyadmin.

Database backup unavailable due to missing required zip extension

This refers to the ZipArchive PHP class which is required by WHMCS to compress the backup. Please recompile PHP with support for this class: http://php.net/manual/en/class.ziparchive.php

Database backup error 'Please provide a valid dump path'

This indicates that WHMCS is unable to access the /tmp working directory during the backup generation process. Please ensure that the open_basedir value is set to Off in your PHP configuration, that the PHP /tmp directory is writeable and is not full.