Change an account's domain or username
Rename a cPanel account's primary domain or username in WHM, and the things that do not follow the change.
Change the primary domain or the username of a cPanel account. Applies to reseller accounts with WHM.
Usually needed when a client rebrands, or when a username was set badly at creation.
Both changes affect a live account. Take a backup first ā see Download a backup of your account ā and do it at a quiet time. Expect brief disruption while DNS updates.
Change the primary domain
- Sign in to WHM.
- Search for Modify an Account.
- Select the account.
- Change the Primary Domain.
- Save.
WHM updates the account's DNS zone, document root and mail configuration.
Change the username
Under Modify an Account, change the Username.
A username change renames the home directory and the prefix on every database and database user. Any application with the old paths or database names in its configuration stops working immediately.
For WordPress, wp-config.php needs the new database name and user. Other
applications need the equivalent. Nothing updates these for you.
What does not follow the change
Check each of these afterwards:
- Application configuration ā database names and absolute paths.
- Cron jobs ā commands with the old home directory path in them.
- SSL certificates ā a new domain needs a new certificate. AutoSSL usually handles it once DNS resolves, see Install a free SSL certificate.
- Email accounts ā mailboxes are on the old domain and are not renamed. Create them on the new domain and migrate the contents, see Migrate email from another provider.
- DNS records ā custom records do not carry across.
- WHMCS, if the account is billed there ā update the domain on the service.
Check it worked
Visit the new domain, sign in to the application, and send a test email. All three, because the failure modes are different.
If the site returns a database connection error, that is the username change and the configuration file ā the most common consequence.
If the old domain must keep working
Add it back as an addon or alias domain pointing at the same document root, then redirect it. Otherwise every existing link and bookmark breaks.
Related
Fix "Invalid Payment Method" in the reseller modules
The Elite and Domain Reseller modules require a default payment method on file, even though orders are paid from your credit balance.
Fix the WHMCS "Licence Invalid" error
WHMCS licences are tied to a domain, IP and directory. Moving the installation invalidates the licence until it is reissued.