Introduction
This guide covers the complete process of migrating WHMCS data between installations and resolving common issues. Whether you’re upgrading your WHMCS installation or moving to a new server, this guide will help you navigate the process successfully.
Table of Contents
- Understanding WHMCS Database Structure
- Data Migration Process
- Handling Payment Gateways
- Common Issues and Solutions
- Post-Migration Verification
- Frequently Asked Questions (FAQ)
1. Understanding WHMCS Database Structure
Key Database Tables
- tblclients: Contains all client information
- tblorders: Stores order information
- tblinvoices: Holds invoice data
- tblinvoiceitems: Contains individual invoice line items
- tblaccounts: Stores transaction records
- tblannouncements: System announcements and notifications
Relationships
- Orders are linked to invoices through invoiceid
- Invoices are connected to clients through userid
- Transactions are linked to invoices and clients
2. Data Migration Process
Step 1: Client Data Migration
SELECT * FROM tblclients
WHERE status = 'Active'
ORDER BY id ASC;
Export and import this data first as it’s the foundation for all other records.
Step 2: Invoice Migration
SELECT * FROM tblinvoices
WHERE date >= '2024-01-01'
ORDER BY date ASC;
Important: Maintain referential integrity with client IDs.
Step 3: Order Migration
SELECT * FROM tblorders
WHERE date >= '2024-01-01'
ORDER BY date ASC;
Step 4: Transaction Records
SELECT * FROM tblaccounts
WHERE date >= '2024-01-01'
ORDER BY date ASC;
3. Handling Payment Gateways
Standardizing Payment Methods
UPDATE tblorders
SET paymentmethod = 'Paypal - Payment request'
WHERE date >= '2024-01-01';
UPDATE tblinvoicesSET paymentmethod = ‘Paypal – Payment request’
WHERE date >= ‘2024-01-01’;
Payment Gateway Migration Checklist
- Export existing payment configurations
- Update payment gateway settings in new installation
- Verify payment gateway functionality
- Test transaction processing
4. Common Issues and Solutions
Dashboard Not Displaying
Check admin permissions:
SELECT a.*, r.name as role_name, r.widgets
FROM tbladmins a
JOIN tbladminroles r ON a.roleid = r.id
WHERE a.username = '[admin_username]';
Reset widget settings:
UPDATE tbladmins
SET homewidgets = 'activity_log:true,getting_started:true,income_forecast:true,income_overview:true,my_notes:true,network_status:true,open_invoices:true,orders_overview:true,supporttickets_overview:true,todo_list:true,whmcs_news:true',
widget_order = ''
WHERE username = '[admin_username]';
Removing Unwanted Announcements
DELETE FROM tblannouncements
WHERE title LIKE '%Thank you for downloading%'
OR announcement LIKE '%nullcave%';
Data Integrity Verification
-- Check invoice-order relationships
SELECT COUNT(*) FROM tblorders o
LEFT JOIN tblinvoices i ON o.invoiceid = i.id
WHERE o.date >= '2024-01-01' AND i.id IS NULL;
— Verify transaction recordsSELECT COUNT(*) FROM tblaccounts
WHERE date >= ‘2024-01-01’;
5. Post-Migration Verification
Essential Checks
- Client Data
- Verify client count matches
- Check client login functionality
- Confirm client permissions
- Financial Records
- Compare invoice totals
- Verify transaction history
- Check payment gateway settings
- System Settings
- Confirm admin access levels
- Verify email templates
- Check automated functions
6. Frequently Asked Questions (FAQ)
Q: How do I migrate only recent data?
A: Use date filters in your SQL queries:
WHERE date >= '2024-01-01'
Q: What should I do if payment methods don’t match?
A: Standardize payment methods using UPDATE queries:
UPDATE tblorders
SET paymentmethod = 'Paypal - Payment request'
WHERE date >= '2024-01-01';
Q: How can I verify successful migration?
A: Use counting queries to compare records:
-- In old database
SELECT COUNT(*) FROM tblorders WHERE date >= '2024-01-01';
— In new databaseSELECT COUNT(*) FROM tblorders WHERE date >= ‘2024-01-01’;
Q: What should I do about missing dashboard widgets?
A: Reset widget settings and clear cache:
UPDATE tbladmins
SET homewidgets = 'default_widgets_string',
widget_order = ''
WHERE username = '[admin_username]';
Q: How do I handle unwanted system messages?
A: Clear announcements and check configuration:
DELETE FROM tblannouncements WHERE published = 1;
UPDATE tblconfiguration SET value = '' WHERE setting LIKE '%notice%';
Conclusion
Successful WHMCS migration requires careful planning and attention to detail. Always backup your data before starting the migration process, verify data integrity at each step, and thoroughly test all functionality after migration. Keep this guide handy for troubleshooting common issues and ensuring a smooth transition.
Remember to:
- Backup all data before starting
- Maintain table relationships
- Verify data after each step
- Test thoroughly after migration
- Document any custom changes made
This guide will help you navigate the complexities of WHMCS migration while maintaining data integrity and system functionality.
Leave A Comment