Skip to content

Quick start

Quick start

WHMCS DataGen is a test-data generator for WHMCS development environments: one-click realistic clients / products / orders / invoices / tickets, with per-batch rollback. This guide covers install, first generation, and cleanup.

Dev/test only — do not install in production. All data writes to real WHMCS tables but is tagged with batch_id for safe rollback.

1. Install and activate

  1. Download the ZIP matching your PHP version and extract into your WHMCS root.
  2. WHMCS admin → Setup → Apps & Integrations → WHMCS DataGen → Activate.
  3. Configuration → Addon Modules → tick admin role + Save.
  4. Addons → WHMCS DataGen opens the console.

2. Dashboard

The dashboard shows:

  • "Generate data" panel: counts (clients / products / orders / invoices / tickets) + start-time offset
  • "Batch history": each generation becomes a batch with a summary + created-at
  • "Cleanup all": one-click wipe of every datagen-written record

3. First generation

Generate-data panel:

  1. Clients: 5 (default)
  2. Products: default hosting / domain templates
  3. Orders: 1 per client
  4. Invoices: auto-generated
  5. Tickets: 1 per client
  6. "Start generation" → background AJAX job
  7. New row appears in "Batch history"

4. Data details

  • Clients: random name / email / phone (local Faker — no external API calls)
  • Products: reuse default hosting product or create demo product
  • Orders: random status (active / pending / cancelled)
  • Invoices: auto-derived from orders (paid / unpaid / overdue mix)
  • Tickets: random subject / message + admin response

5. Cleanup

  • "Cleanup batch": delete a single batch (removes all rows that batch wrote)
  • "Cleanup all": wipe everything datagen ever wrote (keeps default products)

Cleanup runs in a Capsule transaction — atomic.

6. Advanced

  • Scenarios: customise generation via lib/scenarios/GeneralScenario.php
  • Extension: hook whmcs_datagen_run_scenario to inject your own scenario class
  • WHMCS API testing: bulk-load to stress client-list pagination / reports

7. FAQ

Q: Will it pollute my production data? A: All generated data lives in real WHMCS tables but carries batch_id. Strongly recommend dev-only. Production cleanup is still possible by batch_id but risky.

Q: Can generated clients log in? A: Default password Test1234! (same for every generated client) — usable on the client area.

Q: Can I undo cleanup? A: No — it's a real DELETE. Back up the DB before any large run.

Q: How do I tell generated clients from real ones? A: Client notes carry [datagen-batch=XXX] marker, visible in the admin client view.

For deeper docs (scenario extension, Faker template customisation) see the "Full documentation" link on your store dashboard card.