Maintenance

From WHMCS Documentation

Revision as of 20:39, 27 August 2020 by SarahK (talk | contribs) (Backing up your WHMCS Database)

Resetting your database

After you successfully install your billing system, run through a series of tests, including creating client accounts and placing test orders with your particular setup. Often, after you have finished your testing, you will no longer want any of these clients or orders in your system. All you need to do is reset your system, which will remove all of your test accounts.

You can empty all the tables that contain clients' data by running the following SQL code on your database:

TRUNCATE `mod_invoicedata` ;
TRUNCATE `tblaccounts` ;
TRUNCATE `tblactivitylog` ;
TRUNCATE `tblaffiliates` ;
TRUNCATE `tblaffiliatesaccounts` ;
TRUNCATE `tblaffiliateshistory` ;
TRUNCATE `tblaffiliatespending` ;
TRUNCATE `tblaffiliateswithdrawals` ;
TRUNCATE `tblbankaccounts`;
TRUNCATE `tblbillableitems` ;
TRUNCATE `tblcancelrequests` ;
TRUNCATE `tblclients` ;
TRUNCATE `tblclientsfiles` ;
TRUNCATE `tblcontacts` ;
TRUNCATE `tblcredit` ;
TRUNCATE `tblcreditcards`;
TRUNCATE `tblcustomfieldsvalues` ;
TRUNCATE `tbldomains` ;
TRUNCATE `tbldomainsadditionalfields` ;
TRUNCATE `tblemails` ;
TRUNCATE `tblhosting` ;
TRUNCATE `tblhostingaddons` ;
TRUNCATE `tblhostingconfigoptions` ;
TRUNCATE `tblinvoiceitems` ;
TRUNCATE `tblinvoices` ;
TRUNCATE `tblnotes` ;
TRUNCATE `tblorders` ;
TRUNCATE `tblpaymethods`;
TRUNCATE `tblquotes` ;
TRUNCATE `tblquoteitems` ;
TRUNCATE `tblsslorders` ;
TRUNCATE `tblticketlog` ;
TRUNCATE `tblticketnotes` ;
TRUNCATE `tblticketreplies` ;
TRUNCATE `tbltickets` ;
TRUNCATE `tblupgrades` ;

Note
Resetting your database only deletes client accounts and information. You will not lose any configuration or product settings.

Backing up your WHMCS Database

We strongly recommend that you back up your WHMCS database regularly to ensure you always have a copy of your data in case of system failure. Backing up the database is simple using the built-in backup tool:

  1. Log in to your WHMCS Admin Area.
  2. Go to Utilities > Database Status.
  3. Click the Download Full Database Backup button at the top of the page. The system will prompt you to download a file.
  4. Save the file to your computer. Depending on the database size, this may take a few moments.

Restoring a Database Backup

If you need to restore a backup of your database, you will first need to recreate your database, if you haven't already, and drop the existing WHMCS tables.

To restore a database:

  1. Log in to phpMyAdmin and select the database you want to restore.
  2. Click the Import tab at the top:

    Maintenance1.png

  3. Click the Browse button.
  4. Find your backup file and then press OK.
  5. Click Go.

    Maintenance2.png