Restore the WHMCS Database

Data loss is a catastrophic but not unprecedented occurrence. Good backup practices can mitigate the risks and turn a potentially-disastrous situation into manageable downtime.

If a complete backup is not available for restoration, you will need to restore with a database backup. Because the database itself contains all of the data, you can restore a WHMCS installation as long as you have a copy of that database.

We recommend that you review all of the steps in this process (below) before you attempt to perform it on your WHMCS installation.

1. Restore the database backup.

The first step towards recovering from catastrophic data loss is to restore the database backup to your server. You can usually restore database backups to your hosting account via a web interface like phpMyAdmin.

To restore a database:

  1. Log in to phpMyAdmin and select the database that you want to restore.
  2. Select all tables by clicking Check all.
  3. Choose Drop for With Selected.
  4. Go to the Import tab.
    phpMyAdmin Import tab
  5. Click Browse.
  6. Find your backup file and click OK.
  7. Click Go.
For help with this process, contact your hosting provider or system administrator.

2. Replace the WHMCS files.

Next, you must replace any missing WHMCS files. You can do this by downloading a new copy of the WHMCS full release files.

  • If you purchased your license through WHMCS, download these from Download WHMCS.
  • If you purchased your license elsewhere, request a new copy from your reseller.

Unzip the contents of the file to a folder on your computer and upload the contents from the whmcs directory to your existing installation folder.

3. Restore or recreate the configuration file.

The WHMCS database stores encrypted and unencrypted data. Data that is not sensitive is unencrypted (for example, configuration settings, client details, and orders). Sensitive data is encrypted (for example, credit card details, passwords, and security questions).

If you have a database backup, you can salvage all of the unencrypted data, but you will need a backup of your configuration file (configuration.php) to recover the encrypted data.

  • If you have a backup of your configuration.php file, upload it to your installation directory. You can then proceed to performing the post-restoration steps.
  • If you do not have a backup of the configuration.php file, then all password, security questions, and credit card data will remain permanently encrypted and you will not be able to salvage it. In this situation, you must create a new configuration.php file.
    For more information and help to create a configuration.php file, see The configuration.php File.
    After you save the configuration.php file and upload it to your installation directory, your WHMCS installation should run with intact data.

4. Perform post-restoration steps.

After restoring a WHMCS installation, make sure to review all configuration sections in the Admin Area and place a few test orders.

We recommend the following steps:

  1. Log in to the WHMCS Admin Area.
  2. If necessary, reset your admin password.
  3. Review the following settings and configurations:
  4. Place some test orders on your website.

Last modified: May 29, 2024