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.
- 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
- Your hosting provider will be able to assist in this process if you run into problems.
- Next you need to upload a fresh copy of the WHMCS full release files, these can be downloaded from http://download.whmcs.com or from your reseller.
- Upload the configuration.php file from your file backups.
- You should then be up and running with WHMCS once again. Proceed to step 11.
- 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.
- The license value should be filled with your full licence key.
- The database connection details (username, password and name) should be entered
- Your hosting provider will be able to advise the values if you're unsure.
- The cc_encryption_hash value should be a random 50 character string comprising lowercase letters and numbers.
- Save and upload the configuration.php file.
- You should then be up and running once again with most of your data in tact.
- Finally it will be necessary to re-create the cron job(s) and email forwarders.
Sample Configuration.php File
<?php $license=""; $db_host = "localhost"; $db_username = ""; $db_password = ""; $db_name = ""; $cc_encryption_hash = ""; $templates_compiledir = "templates_c/"; ?>