The Wild

How to Migrate WHMCS: Full Step-by-Step Guide

· 5 min read · Mammals

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Migrating WHMCS to a new server or hosting provider involves moving your files, database, and configuration so your billing system continues to work without downtime or data loss. This guide walks you through the entire process, from preparation to post-migration checks, so you can move safely and confidently.

What You'll Need

  • Access to your current WHMCS installation (admin panel and file system).
  • Access to the new server (cPanel, Plesk, or SSH).
  • FTP/SFTP client (e.g., FileZilla) or shell access.
  • Database credentials for both old and new servers.
  • A temporary maintenance page (optional but recommended).
  • Your WHMCS license key (you may need to update the domain/IP).

Step-by-Step

  1. Back up your current WHMCS files and database. In your old WHMCS admin area, go to Utilities > System > Backups and create a full backup. Alternatively, use your hosting control panel to download the entire WHMCS directory and export the MySQL database (e.g., via phpMyAdmin). Ensure the backup includes all files, including the configuration.php file (contains database credentials) and the attachments folder (if you store client documents).
  2. Prepare the new server. Ensure the new server meets WHMCS minimum requirements (PHP version, MySQL, IonCube Loader, etc.). Create a new database and database user, and assign all privileges to that user. Note the new database name, username, and password.
  3. Upload the WHMCS files. Using FTP or SSH, upload all WHMCS files to the new server's document root (e.g., public_html or a subfolder). If you have a large installation, use compressed archives (tar.gz or zip) and extract them on the server to save time.
  4. Import the database. In the new server's phpMyAdmin (or via command line), select the new database and import the SQL backup file you created earlier. If the file is large, split it or use the command line (mysql -u user -p database < backup.sql).
  5. Update the configuration file. Edit configuration.php in the new WHMCS directory. Change the $db_host, $db_username, $db_password, and $db_name to match the new database credentials. Also update $cc_encryption_hash if you had it set (usually kept the same, but ensure it's intact).
  6. Update the WHMCS license. Log in to the WHMCS client area and update your license to point to the new domain/IP if it has changed. If you are moving to a new domain, you may need to update the license key in configuration.php as well.
  7. Set file permissions. Ensure that directories such as templates_c, attachments, and downloads are writable (usually 755 or 777 depending on server setup). Correct permissions prevent errors.
  8. Test the new installation. Before going live, temporarily edit your local hosts file or use a test subdomain to access the new WHMCS. Log in to the admin area, verify that all clients, invoices, and products are present. Check that cron jobs are configured correctly.
  9. Update DNS and go live. Once testing passes, point your domain's DNS to the new server. Wait for DNS propagation (can take up to 48 hours). During this time, you can keep the old server running to avoid downtime.
  10. Set up cron jobs. On the new server, create the WHMCS cron job (usually every 5 minutes) pointing to cron.php in the WHMCS directory. Test the cron job manually first.
  11. Post-migration checks. After DNS propagation, verify that the site loads, client login works, payment gateways respond, and email sending works. Check the activity log for errors. Once everything is stable, cancel the old server.

Common Mistakes

  • Forgetting to update configuration.php – This causes database connection errors.
  • Not updating the license – WHMCS may stop working if the domain/IP doesn't match.
  • Incorrect file permissions – Writable directories are essential for templates and attachments.
  • Skipping a test run – Going live without testing can lead to broken pages and lost data.
  • Not backing up the attachments folder – Client documents are stored there and are easy to miss.
  • Changing the encryption hash – If you change it, existing client passwords and credit card data become unreadable.

Tips

  • Use a staging subdomain (e.g., staging.yourdomain.com) for testing before switching DNS.
  • Compress the WHMCS files and database backup to speed up the transfer.
  • Keep the old server active until DNS fully propagates to avoid downtime.
  • Use a maintenance page during the final switch to inform visitors.
  • Record all old server settings (cron jobs, email settings) so you can replicate them.
  • If you have a large database, use command-line import instead of phpMyAdmin to avoid timeouts.

Troubleshooting

  • Database connection error – Check configuration.php for correct credentials, and verify the database exists and the user has privileges.
  • Blank page after migration – Enable error reporting by adding ini_set('display_errors', 1); at the top of configuration.php to see the actual error. Common causes: missing IonCube Loader, PHP version incompatibility, or corrupted files.
  • License not working – Update your license in the WHMCS client area. If the problem persists, contact WHMCS support.
  • Emails not sending – Check your SMTP settings in WHMCS admin (Setup > General Settings > Mail). Ensure the new server allows outbound SMTP.
  • Cron job not running – Verify the cron command path is correct and the cron.php file is executable. Test manually via browser or command line.
  • Attachments missing – Ensure the attachments folder was uploaded and has the correct permissions.

Frequently Asked Questions

Can I migrate WHMCS to a different domain?

Yes, but you must update your license key in the WHMCS client area to the new domain, and update the configuration.php if needed. Also, update any hardcoded URLs in emails or templates.

How long does the migration take?

The active work typically takes 1-3 hours, depending on the size of your installation and your experience. DNS propagation can add up to 48 hours for full switchover.

Do I need to re-enter all my client data?

No, as long as you back up and import the database correctly, all client data, invoices, and products will be preserved.

What is the encryption hash and why is it important?

The $cc_encryption_hash is used to encrypt sensitive data like client passwords and credit card numbers. If you change it, existing data becomes unreadable. Keep it the same during migration.

Can I migrate without downtime?

Yes, if you keep the old server running until DNS propagates. Use a maintenance page on the new server during testing, then switch DNS and remove the maintenance page.

What if my new server has a different PHP version?

WHMCS requires specific PHP versions (usually 7.4 or 8.x). Check the WHMCS system requirements and ensure your new server matches. If not, upgrade or downgrade PHP accordingly.