How to Migrate WHMCS to a New Domain

Migrating WHMCS to a new domain can seem complex, but with careful planning and execution, you can make it smooth and error-free. This guide covers every step: from preparing the domain to backing up data, transferring files, updating configurations, fixing licensing, email issues, and post-migration validation.

1: Prepare Your New Domain and Hosting

  • Register your new domain and point it to your new hosting server.
  • Ensure DNS propagation is complete (usually takes a few hours).
  • Install SSL (https) for secure connection.
  • Make sure the server meets WHMCS requirements (PHP, MySQL, IonCube Loader, etc).
  • Create a hosting account (e.g., cPanel, Plesk, VPS or dedicated server).

2: Backup Existing WHMCS Installation

  • Login to the WHMCS Admin Panel.
  • Go to Utilities > System > Database Backup and download the SQL file.
  • Use File Manager or FTP (like FileZilla) to download the full WHMCS folder (usually /public_html/billing).

3: Upload WHMCS Files to the New Domain

  • Upload the WHMCS folder to your new domain’s root (e.g., /public_html/billing).
  • Double-check that the following folders are included:
    • attachments
    • downloads
    • templates_c
whmcs important migration files

4: Create and Import the WHMCS Database

  • Login to your new hosting control panel.
  • Create a new MySQL database and user.
  • Assign full privileges to the user.
  • Open phpMyAdmin and import the SQL file you backed up.

5: Update WHMCS Configuration File

  • Go to /billing/configuration.php
  • Update the database settings:
$mysql_host = 'localhost';
$mysql_username = 'your_new_db_user';
$mysql_password = 'your_new_db_password';
$mysql_db = 'your_new_db_name';
configuration of whmcs while migrating

Step 6: Fix File & Folder Permissions

Set correct folder permissions so WHMCS can run properly:

chmod 755 attachments downloads templates_c

Alternatively, use File Manager and set permissions manually.

7: Reissue Your WHMCS License

  • Login to your WHMCS client account (where you purchased the license).
  • Go to Services > My Licenses
  • Click on your license > Reissue License
  • This allows WHMCS to bind to your new domain.
whmcs license reissue

8: Update System URL in WHMCS

  • Login to WHMCS Admin on the new domain.
  • Go to Setup > General Settings > General tab.
  • Update the “WHMCS System URL” to match your new domain (e.g., https://yournewdomain.com/billing).

9: Configure Email Settings (Highly Important)

  • Go to Setup > General Settings > Mail tab.
  • Update the “From” email address (it should use your new domain).
  • If using SMTP:
    • Update hostname (e.g., smtp.yournewdomain.com)
    • Update SMTP username and password
    • Make sure SMTP ports are allowed on your new host
  • Send a test email to ensure it works (Utilities > Email Log)

10: Clear Cache & Templates

  • Go to /templates_c/
  • Delete all files inside (but not the folder itself)

11: Update Cron Job (if changed)

If your server path is different:

  • Go to Setup > Automation Settings
  • Update the cron command according to the new full path
Update Cron Job

12: Run System Health & Test Everything

  • Go to Utilities > System > Health and Updates
  • Run the Health Check and fix any warnings or errors
  • Test:
    • Login/logout
    • Registration
    • Ticket submission
    • Invoicing
    • Email delivery

FAQ: Common Issues & Fixes

Q1: I’m getting “Unable to access email attachment storage”

A: This means WHMCS cannot write to folders like attachments or templates_c. Set permissions to 755 or 775 and ensure the folders exist.

Q2: My emails are not sending

A: Recheck your SMTP settings in Setup > General Settings > Mail. If you’re using PHP Mail, make sure it’s enabled on your new host. Also check firewall and port restrictions.

Q3: WHMCS License Error or Invalid License

A: WHMCS licenses are domain-specific. Login to your WHMCS client portal, reissue the license, and reload the new domain.

Q4: Google Sign-in or OAuth flow is asking for address/extra fields

A: Go to Setup > Custom Client Fields and disable “Required” for all non-essential fields. Edit the OAuth registration template to remove unnecessary inputs.

Q5: The website is loading without CSS or stuck in a redirect loop

A:

  • Check that your System URL is updated in General Settings.
  • If necessary, define it directly in configuration.php:
define('WHMCS_URL', 'https://yournewdomain.com/billing');
  • Clear browser cache and .htaccess rules.

Q6: Domain pointing isn’t working

A: Check your DNS settings. Make sure your domain is pointing to the correct IP, and that A records are properly set. Use tools like intodns.com or whatsmydns.net.

Q7: Cron Job not working

A: Make sure the new path to php and cron.php is valid. Use cPanel > Cron Jobs to edit it. Add logs to debug if needed.

Q8: Client or Admin area is showing blank page

A: Enable display_errors in php.ini or WHMCS configuration. This will help reveal the error. Often caused by missing PHP extensions or wrong permissions.

Q9: Login with Google not working on new domain

A: Make sure the new domain is added to the allowed OAuth redirect URIs in your Google Developer Console project. Update client ID settings accordingly.

Q10: Emails going to spam after migration

A: Setup SPF, DKIM, and DMARC records for your domain. Ensure proper reverse DNS is configured on your mail server.

By following this complete guide and resolving common issues via the FAQ, your WHMCS should be successfully migrated and running smoothly on the new domain.