Change domain on hosting and on the website, how it works

To change domain on hosting there are two separate parts. Konet changes the primary domain of your cPanel account free of charge when you request it with a ticket, and the account stays on the same plan with the same expiry date. The domain inside the website changes separately, in its database and files, and at the end you make the old domain redirect to the new one with a 301 redirect.

What changes on the hosting and what on the website

The primary domain is the name your cPanel account was created with. When it changes, cPanel updates the email accounts, the DNS records and the domain settings. info@example.gr becomes info@neo-example.gr with the same content. The cPanel username, the databases and the files stay the same. The document root of the primary domain, meaning the public_html folder, does not change.

The website does not change on its own. A CMS such as WordPress stores the site address in the database, in settings, in links and in images. If you don't change these, the site will keep requesting pages from the old domain.

Before you start

  • The new domain must be registered and you must be able to change its nameservers or DNS records.
  • The new domain must not already exist in your account as an addon domain or alias. If you have added it, remove it first from cPanel > Domains > Domains or mention it in the ticket.
  • Download a full backup from cPanel > Files > Backup > Download a Full Account Backup or from JetBackup 5, as shown in the JetBackup 5 guide.
  • If the new domain's DNS is hosted elsewhere, lower the TTL of its records in advance, so the change goes through quickly.

How to request a primary domain change in cPanel

At Konet, we rename the primary domain in cPanel ourselves, on request and free of charge. The request is made only with a ticket.

  1. Log in to the Client Area with the account of the service owner.
  2. Open a ticket for that specific hosting plan.
  3. Write the current primary domain and the new one.
  4. Say whether you want the old domain to stay in the account as an alias for the redirect.
  5. Ask for a time that suits you. We suggest a time when the site has little traffic.

If a partner of yours opens the ticket, the owner's written confirmation is needed in the same ticket. When the change is complete, we reply in the ticket. If the new domain's nameservers don't point to Konet yet, we send you the details you need to set. For a .gr domain, see changing nameservers.

DNS changes usually go through within a few hours. On some networks it can take up to 48 hours. The free SSL certificate for the new domain is issued automatically as soon as the domain points to the server.

Changing the domain in WordPress and other websites

Converting the website is the job of whoever manages the site, as we explain in what hosting support covers. If you don't want to do it yourself, Konet can move the site to the new domain, including the changes to files and database, for a small fee. Mention it in the same ticket. How difficult it is depends on the CMS and how up to date it is.

In WordPress the process is the easiest.

  1. Back up the database from phpMyAdmin > Export, even if you already have a full backup.
  2. Change the WordPress URL under Settings > General, in the WordPress Address (URL) and Site Address (URL) fields.
  3. Replace the old domain with the new one throughout the database with a search and replace tool that supports serialized data, for example a search and replace plugin or a migration plugin.
  4. Clear the cache of LiteSpeed Cache or whichever cache plugin you use, as shown in clearing the website cache.
  5. Open pages, images and forms on the site and check that they load from the new domain.

Don't replace the address with a plain find and replace in an SQL file. WordPress stores many settings in serialized form, which breaks when the length of the text changes.

In other CMSs or old versions the address may appear in configuration files, in the database and inside the content. If the version is very old, it is often safer to build the site from scratch on the new domain and move the content over.

How do I make the old domain open the new one with a 301 redirect

If you are keeping the old domain active and asked for it to stay in the account as an alias, add a permanent 301 redirect.

  1. Open cPanel > Domains > Redirects.
  2. Under Type, select Permanent (301).
  3. Select the old domain and leave the field after the / empty.
  4. In Redirects to, enter the address of the new domain with https.
  5. Click Add.

A 301 tells search engines that the site has moved permanently, so the old links are not lost. See the cPanel Redirects tool in detail. The old domain must stay registered and renewed for as long as you want the redirect to work.

Frequently Asked Questions

Is there a charge for changing the primary domain?
No. Konet changes the primary domain free of charge when you request it with a ticket. The account stays on the same plan, the expiry date doesn't change and no new hosting order is needed.

Can Konet move my site to the new domain for me?
Yes. If you want us to handle converting the site as well, meaning the changes to the files and the database, we do it for a small fee. Mention it in the ticket along with the CMS the site uses.

Will I lose my emails?
No. The email accounts are renamed to the new domain with their content. Let your contacts know the new addresses and change the username in your email programs, for example from info@example.gr to info@neo-example.gr.

Will my addon domains and subdomains be lost?
Addon domains and aliases are not affected by the primary domain change. Subdomains of the primary domain, such as blog.example.gr, belong to the old name, so say in the ticket if you want them to exist on the new one too.

Can I add an addon domain or alias myself?
Yes. You manage addon domains and aliases from cPanel > Domains > Domains, with Create a New Domain for a new one and Manage for settings or removal. See managing domains in cPanel.

Do I need to change anything in the database connection?
No. The cPanel username stays the same, and so do the names of the databases and their users. Only the site address inside the database changes.

After the change the site shows a page with no styling or with broken images.
Usually the database still has the old domain or the cache is holding old pages. Run the replacement across the whole database and clear the cache. If something goes wrong, restore the database from the backup you took.

The new domain still shows the old site or an SSL warning.
DNS propagation has not finished. Wait a few hours and try again. The SSL certificate is issued automatically as soon as the domain points to the server.

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups: 24 every 2 hours for 48 hours, then 6 daily, 4 weekly and 3 monthly.