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.
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:
- Log in to phpMyAdmin and select the database that you want to restore.
- Select all tables by clicking Check all.
- Choose Drop for With Selected.
- Go to the Import tab.
- Click Browse.
- Find your backup file and click OK.
- Click Go.
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 newconfiguration.php
file.After you save theFor more information and help to create aconfiguration.php
file, see The configuration.php File.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:
- Log in to the WHMCS Admin Area.
- If necessary, reset your admin password.
- Review the following settings and configurations:
- Configuration () > System Settings > General Settings
- Configuration () > System Settings > Payment Gateways
- Configuration () > System Settings > Servers
- Configuration () > System Settings > Domain Registrars
- Your cron jobs or email forwarders.
- Place some test orders on your website.
Last modified: October 30, 2024