Restoring WHMCS

From WHMCS Documentation

Data loss is a catastrophic but not unheard of occurrence. Good backups will turn a potentially disastrous situation into regrettable downtime, but if complete backups are not available for restoration, this guide shows how to restore a WHMCS installation from backups of its constituent parts.

The WHMCS is comprised of two main parts; the MySQL database which contains the settings and data, and the files which tell the software how to operate and control its appearance. Provided you have a backup of the database then most data can be salvaged, if you you also have a backup of the configuration.php file then all the data can be recovered.

  1. The first step is to restore the database backup to your server. Database backups can usually be restored to your hosting account via a web interface such as phpmyadmin. Instructions for doing so are published in our documentation; Restoring a Database Backup
    1. Your hosting provider will be able to assist in this process if you run into problems.
  2. Next you need to upload a fresh copy of the WHMCS full release files, these can be downloaded from or from your reseller.
  3. Upload the configuration.php file from your file backups.
  4. You should then be up and running with WHMCS once again. Proceed to step 11.
  5. If you do not have a backup of the configuration.php file then all password, security questions and credit card data will be scrambled. A new configuration.php file will need to be created using the template at the bottom of this guide.
  6. The license value should be filled with your full licence key.
  7. The database connection details (username, password and name) should be entered
    1. Your hosting provider will be able to advise the values if you're unsure.
  8. The cc_encryption_hash value should be a random 50 character string comprising lowercase letters and numbers.
  9. Save and upload the configuration.php file.
  10. You should then be up and running once again with most of your data in tact.
  11. Finally it will be necessary to re-create the cron job(s) and email forwarders.

Sample Configuration.php File

$db_host = "localhost";
$db_username = "";
$db_password = "";
$db_name = "";
$cc_encryption_hash = "";
$templates_compiledir = "templates_c/";