# Change an account's domain or username
Source: https://docs.webgee.com/en/reseller/how-to-change-a-cpanel-users-domain-name-or-username-via-whm



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.

<Callout type="warn">
  Both changes affect a live account. Take a backup first — see
  [Download a backup of your account](/en/backups/how-to-generate-download-a-website-backup)
  — and do it at a quiet time. Expect brief disruption while DNS updates.
</Callout>

## Change the primary domain [#change-the-primary-domain]

1. Sign in to **WHM**.
2. Search for **Modify an Account**.
3. Select the account.
4. Change the **Primary Domain**.
5. Save.

WHM updates the account's DNS zone, document root and mail configuration.

## Change the username [#change-the-username]

Under **Modify an Account**, change the **Username**.

<Callout type="error">
  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.
</Callout>

## What does not follow the change [#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](/en/security-ssl/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](/en/email/migrating-emails-from-imap-providers-using-our-migration-center).
* **DNS records** — custom records do not carry across.
* **WHMCS**, if the account is billed there — update the domain on the service.

## Check it worked [#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 [#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 [#related]

* [Download a backup of your account](/en/backups/how-to-generate-download-a-website-backup)
* [Create and manage MySQL databases](/en/databases/how-to-create-and-manage-mysql-databases-in-cpanel)
