Overview
Migrating domain records imports the registration data into Commerce so clients can see their domains, manage renewals, and view expiry dates in the portal. This does not move the domain registration itself — the domain remains registered at the same registrar, unchanged.
Client records must exist before domain records can be imported.
Exporting from WHMCS
Export domain data from the WHMCS tbldomains table:
SELECT id, userid, orderid, type, registrationdate,
domain, firstpaymentamount, recurringamount,
registrar, registrationperiod, expirydate,
status, nextduedate, nextinvoicedate,
idprotection, do_not_renew,
ns1, ns2, ns3, ns4
FROM tbldomains
ORDER BY id;
Save as a CSV file.
Required Fields for Import
| Commerce Field | WHMCS Source Column | Notes |
|---|---|---|
domain_name |
domain |
Full domain including TLD |
client_id |
userid |
Must match an existing client ID |
status |
status |
See status mapping below |
registration_date |
registrationdate |
ISO 8601 date |
expiry_date |
expirydate |
ISO 8601 date |
registrar_module |
registrar |
See registrar mapping below |
ns1 – ns4 |
ns1 – ns4 |
Nameserver values |
auto_renew |
Inverse of do_not_renew |
true if do_not_renew = 0 |
whois_privacy |
idprotection |
true if idprotection = 1 |
next_due_date |
nextduedate |
ISO 8601 date |
Registrar Name Mapping
WHMCS and Commerce use different identifiers for registrar modules. Map them before import:
| WHMCS Registrar Name | Commerce Module ID |
|---|---|
resellerclub |
resellerclub |
enom |
enom |
namecheap |
namecheap |
opensrs |
opensrs |
hexonet |
hexonet |
If your registrar is not listed, check Admin → Settings → Registrars for the module ID used in Commerce.
Domain Status Mapping
| WHMCS Status | Commerce Status |
|---|---|
Active |
active |
Expired |
expired |
Transferred Away |
transferred_away |
Pending Transfer |
pending_transfer |
Cancelled |
cancelled |
Running the Import
- Go to Admin → Domains → Import CSV.
- Upload your prepared CSV file.
- Map columns to Commerce fields on the mapping screen.
- Click Import.
- Review the summary. Failed rows will list the reason (typically a missing client ID or invalid date format).
Post-Import Verification
After importing, verify a sample of records:
- Check that expiry dates are correct — compare against WHMCS and the registrar's own portal.
- Verify nameservers are populated correctly on several domains.
- Confirm
auto_renewflags match the client's preference. - For registrars with API integration, use the domain sync feature (Admin → Domains → Sync) to pull current data directly from the registrar API.
[!TIP] Sort by
expiry_date ASCafter import and review the earliest-expiring domains first. These are the ones most likely to cause problems if data is incorrect.
[!IMPORTANT] This migration imports records only. No re-registration occurs. The domain remains at its current registrar. What changes is that Commerce now tracks the domain and can send renewal reminders, generate renewal invoices, and let clients manage nameservers through the portal.