Upgrading from MIGS to MPGS (WHMCS Gateway Migration Guide)
This article explains how to switch existing WHMCS clients, services, domains, and invoices from the legacy MIGS gateway module to the newer MPGS gateway module.
Before You Start
- Take a database backup (full WHMCS DB export) before making any changes.
- Do this during a quiet period if possible (to avoid clients paying invoices while you are changing payment methods).
- Have your new MPGS gateway configured and tested (a $0 test invoice or a small internal invoice is ideal).
Step 1: Install and Configure MPGS
- Upload/install the MPGS gateway module files into your WHMCS installation.
- In WHMCS Admin: Configuration > System Settings > Payment Gateways
- Activate MPGS and enter the required credentials/settings.
- Confirm MPGS appears as an available payment method for invoices.
Recommended Method (WHMCS Admin): Deactivate MIGS and Reassign
WHMCS can automatically reassign products/services/invoices when a gateway is deactivated.
- Go to: Configuration > System Settings > Payment Gateways
- Locate MIGS and choose Deactivate.
- When prompted to reassign items using MIGS, select MPGS as the replacement gateway.
- Confirm the reassignment.
After doing this, review a few client profiles and invoices to ensure MPGS is now selected as expected.
Alternative Method (Database Bulk Update)
If you prefer (or need) to handle this in bulk directly in the database, use the steps below.
3.1 Identify the Internal Gateway Names
WHMCS stores the gateway as a short internal name (often the gateway filename without .php). You must confirm the exact values used on your system.
Run these read-only queries first:
SELECT defaultgateway, COUNT(*) AS total
FROM tblclients
GROUP BY defaultgateway
ORDER BY total DESC;
SELECT paymentmethod, COUNT(*) AS total
FROM tblhosting
GROUP BY paymentmethod
ORDER BY total DESC;
SELECT paymentmethod, COUNT(*) AS total
FROM tbldomains
GROUP BY paymentmethod
ORDER BY total DESC;
SELECT paymentmethod, COUNT(*) AS total
FROM tblinvoices
GROUP BY paymentmethod
ORDER BY total DESC;
Find the value that represents MIGS (example: migs) and the value that represents MPGS (example: mpgs).
3.2 Perform the Bulk Update
Important: Replace migs and mpgs below with the exact names found in your system.
START TRANSACTION;
-- Client default payment gateway
UPDATE tblclients
SET defaultgateway = 'mpgs'
WHERE defaultgateway = 'migs';
-- Products/Services payment method
UPDATE tblhosting
SET paymentmethod = 'mpgs'
WHERE paymentmethod = 'migs';
-- Domain payment method
UPDATE tbldomains
SET paymentmethod = 'mpgs'
WHERE paymentmethod = 'migs';
-- Invoice payment method (updates existing invoices that were set to MIGS)
UPDATE tblinvoices
SET paymentmethod = 'mpgs'
WHERE paymentmethod = 'migs';
COMMIT;
Saved Cards / Tokens (If Your Setup Uses Them)
Your installation may not use stored cards/tokens. However, some WHMCS deployments do use “Pay Methods” (saved payment methods) and tokenised payments.
Key rule: Only migrate saved payment methods if MPGS can use the same token data that MIGS stored. If the tokens are not compatible, changing gateway references can cause saved cards to fail. In that case, clients should re-add their payment method under MPGS.
Optional: Update Pay Methods Gateway Name
If you have confirmed compatibility and want to migrate stored pay methods, WHMCS stores these in tblpaymethods:
START TRANSACTION;
UPDATE tblpaymethods
SET gateway_name = 'mpgs'
WHERE gateway_name = 'migs';
COMMIT;
If you are unsure about token compatibility, do not run the update above. Instead, allow clients to re-save their card under MPGS.
Post-Migration Checklist
- Open a few client profiles and confirm their Default Payment Method is MPGS (where applicable).
- Check a selection of active services and domains and confirm MPGS is selected as the payment method.
- Check a handful of Unpaid invoices and confirm the invoice payment method is MPGS.
- Perform a real payment test (small internal invoice) using MPGS.
Verification Queries (Quick Health Check)
After migration, these should return 0 rows (or a count of 0) for MIGS.
SELECT COUNT(*) AS clients_still_migs
FROM tblclients
WHERE defaultgateway = 'migs';
SELECT COUNT(*) AS hosting_still_migs
FROM tblhosting
WHERE paymentmethod = 'migs';
SELECT COUNT(*) AS domains_still_migs
FROM tbldomains
WHERE paymentmethod = 'migs';
SELECT COUNT(*) AS invoices_still_migs
FROM tblinvoices
WHERE paymentmethod = 'migs';
Rollback (If Needed)
If something goes wrong and you need to revert:
- Restore your database backup, OR
- Run the same updates in reverse (swap
mpgsback tomigs)
Notes and Best Practices
- If you are migrating a live billing system, avoid running changes while a payment batch/automation is processing.
- Keep MIGS disabled once fully migrated to prevent new invoices/services being created with the old gateway.
- If clients report payment issues after the change, confirm the invoice payment method and client default gateway are set to MPGS.