# Moving from ClientExec

CWP Billing imports a ClientExec 6.x or 7.x database. Clients keep their passwords (ClientExec PBKDF2 and the WHMCS
formats ClientExec took over), the login form keeps ClientExec's field names, and client, service, invoice and ticket
numbers stay the same. ClientExec is only read. The full guide: https://docs.control-webpanel.com (CWP Billing →
Moving from ClientExec).

1. Fresh installation, **Automation enabled** off (Billing settings).
2. In `config/config.php`, a database user with SELECT on the ClientExec database:

       'clientexec' => ['host' => 'localhost', 'name' => 'clientexec_db', 'user' => 'billing', 'pass' => '…',
                        'charset' => 'utf8mb4', 'uploads_dir' => '/path/to/clientexec/uploads'],

3. Import (repeat as often as you like):

       php bin/console import:clientexec
       php bin/console import:clientexec --only=tickets,replies,attachments

4. Optional clean-up after a full import:
   * `--cancel-stale-unpaid`: cancel unpaid invoices of packages that no longer run;
   * `--cancel-unbilled`: cancel active packages that ClientExec never invoices;
   * `--convert=HRK:EUR:7.5345`: convert a currency you no longer use, at a fixed rate.
5. Enter the gateway keys, server API keys and registrars (they are not imported, ClientExec encrypts them), enable
   the staff you need and set their passwords.
6. Switch: disable the ClientExec cron, final import, point the domain to the billing, change the PayPal/Stripe
   notification URLs, run `php bin/console billing:preview`, then turn **Automation enabled** on.
