Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  cPanel  >  How to Move a Website to Another Domain on cPanel – MilesWeb Guide

How to Move a Website to Another Domain on cPanel – MilesWeb Guide

 3 min

Changing your website’s domain name can seem like a complex process, but with MilesWeb’s cPanel hosting, it becomes much more manageable. Whether you are rebranding or acquiring a better domain, migrating your site correctly ensures that you maintain functionality and SEO value. This guide will walk you through moving a website to another domain name on MilesWeb’s cPanel with a step-by-step approach.

Prerequisites

  1. Before proceeding with the domain migration, ensure you have the following:
  2. MilesWeb cPanel access for both the old and new domains.
  3. A backup of your website files and databases.
  4. Updated DNS records for the new domain.
  5. FTP or File Manager access to transfer files.
  6. Basic knowledge of cPanel operations.

Step 1: Backup Your Website Files and Database

Backup Files:

  1. Log into your MilesWeb cPanel.
  2. Navigate to File Manager and open the public_html directory.
  3. Select all files and click Compress to create a ZIP archive.
  4. Download the ZIP file to your local system.

Backup Database:

  • In cPanel, go to phpMyAdmin.
  • Select your database from the left panel.
  • Click on the Export tab and choose Quick as the export method.
  • Click Go to download the SQL file.

Step 2: Add a New Domain in MilesWeb CPanel

  1. In MilesWeb cPanel, head over to Addon Domains.
  2. Type in the new domain and set the document root to public_html/newdomain.
  3. You are finished when you click on Add Domain.

Step 3: Transfer Files to the New Domain

Launch File Manager from cPanel.

  1. Go to the new domain directory, which is located in public_html/newdomain.
  2. Transfer the ZIP file that contains files for your website.
  3. Uncompress the ZIP file.

Step 4: Make a new database and import an existing one.

Select MySQL Databases in cPanel.

  • Make a new database and remember its name.
  • Create a new user for this database with full permissions.
  • In the newly created database, go to phpMyAdmin and then click on Import.
  • Select the SQL file that you previously downloaded and click Go for the importing process.

Step 5. Updating Configuration Settings

For WordPress Websites: 

  • Access your File Manager and reset your wp-config.php file. 
  • Find these lines and make the required changes: 
define( 'WP_HOME', 'https://newdomain.com') ;
define( 'WP_SITEURL', 'https://newdomain.com') ;

Please ensure that the changes are kept and then proceed further. 

For Other CMS or Custom Websites: 

Change any configuration files that have the old domain in them.

If needed, modify database URLs using phpMyAdmin alongside an SQL query such as: 

UPDATE wp_options SET option_value = replace(option_value, 'https://olddomain.com','https://newdomain.com') WHERE option_name = 'siteurl' OR option_name = 'home';

Step 6. Changing DNS Records  

  • Navigate to your domain registrar and change your A record to redirect to MilesWeb’s hosting server. 
  • Make changes to domain settings if using a CDN or Cloudflare. 
  • Please wait until the next 24 hours for full-service propagation. 

Step 7: Develop 301 Redirects for SEO 

  • In order to preserve SEO rankings, create 301 redirects from the old website link to the new one: 
  • Change your .htaccess file located in public_html for the old domain. 
  • In the file, add the following lines:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L, R3 01, NC, NC]

Ensure the file has been saved and uploaded.

Step 8: Modify Requirements on Google Search Console and Analytics

  • Access your Google Search Console account and input the newly acquired domain.
  • Utilize the Change of Address Tool to notify Google regarding the relocation.
  • Modify your domain name in Google Analytics.
  • Search for broken links and resolve any existing problems.

Step 9: Validate the Functionality of the Website

  • Launch a browser and navigate to your new domain. Confirm that all pages are loading.
  • Carry out testing on forms, images, and other functionalities.
  • Perform an SEO audit to check for redirects, indexing, and other aspects.
Conclusion

Using MilesWeb cPanel to migrate a website to a new domain follows a logical sequence designed to maintain uptime and protect your SEO. By carefully executing the steps above, you can migrate your website with no loss of traffic and data integrity.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.