> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.clientexec.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Import WHMCS Data into Clientexec

The **WHMCS Importer** plugin in Clientexec allows you to import clients, packages, invoices, tickets, and servers from your existing WHMCS installation.
This article walks you through the process of using the importer via both the **web interface** and the **command-line interface (CLI)**.

|| Before proceeding please generate a backup of both your WHMCS database and Clientexec database giving you the ability to revert back in the event of an issue. Also, please first make sure to set your default currency, as the imported data will use that currency.

|| The WHMCS importer has been tested with WHMCS 8.x though may be compatible with other versions.

### ⚠️ Before You Begin

* ✅ **Back up your databases** (WHMCS & Clientexec)
* 💱 **Set your default currency** in Clientexec: Go to **Settings > Billing > Currencies**, check your preferred currency, and click **Set Default (*Changing this after importing will not update the imported data.*)**
* ✅ The importer has been tested with WHMCS **version 8.x**, though it may work with other versions.
* ❗ Packages marked **“Collections”** in WHMCS will be set as **“Active”** in Clientexec.
Invoices marked “Collections” will import as **“Unpaid.”** (*Update these statuses in WHMCS **before** importing if needed.*)

## 🧩 Using the WHMCS Importer in Clientexec (Web UI Method)

1. **Login** to your Clientexec installation.
2. Navigate to: **Settings > Utilities > Import Data > WHMCS**
3. Enter the required WHMCS database details:
You can find these in your WHMCS `configuration.php` file:
    * Database Host
    * Database Name
    * Database Username
    * Database Password
    * Database Port
    * CC Encryption Hash
4. Click **Start Import** and wait for the process to complete.

### 🔁 Continuing PayPal Subscriptions?
If you're using **PayPal Subscriptions**, add the following redirect to the top of your `.htaccess` file:

```
Redirect 301 /modules/gateways/callback/paypal.php /plugins/gateways/paypal/callbackRedirect.php
```
Adjust the path if your WHMCS or Clientexec directories differ.

## 🖥️ Importing via Command-Line (CLI) – For Large Imports

As of **Clientexec 6.7.0**, the WHMCS importer supports command-line imports for larger datasets that may timeout in the UI.

To import using this method, you would need to connect to your site using SSH ([PuTTY](https://www.putty.org/) is a good tool for this.) and then navigate to your\_clientexec\_directory/plugins/import/whmcs and then run:

```html
php cli.php 'db host' 'db name' 'db username' 'db password' 'db port' 'cc encryption hash'
```

replacing:

**db host** with your whmcs database host.
**db username** with your whmcs database username.
**db password** with your whmcs database password
**db port** with your whmcs database port
**cc encryption hash** with the cc encryption has from your whmcs.

This information can be found in your whmcs configuration file. 

| New in 6.6.1: The WHMCS importer has been updated to import invoice transactions!

|| If you experience any issues while migrating to Clientexec feel free to send an email to support@clientexec.com for assistance.
