Changing the Domain of Your WordPress Site

Changing the Domain of Your WordPress Site

As a business, it is possible to market a well-known product with multiple names or brands, and you’d prefer to have distinct domains for each item. This is the reason you might be required to duplicate your WordPress website’s content and host it under an additional part.

Instead of creating a separate website in each domain, you can make use of the content that is already within your fields. This guide will assist you with duplicates of a WordPress website.

Be aware that these steps may not be sufficient to completely change your domain due to the way WordPress is a server-side application. Before you begin, it is suggested that you create a complete copy of your site by using this backup feature in the cPanel.

Important Note:

HostGator does not accept requests for cloning of sites at the present moment, and the instructions below are only suggested if you’re fully educated about how to manage WordPress files. It is strongly recommended to reach out to your web designer and request them to create this for you instead. This guide could break your website if not executed correctly, and HostGator is unable to reverse the process.

Step 1: Copy Files/Content to the New Domain

Click Here to add the new domain to the cPanel’s Addon Domains section, then follow the steps below to transfer files to the new environment.

  1. Log in to cPanel.
  2. Look for the Files section and click File Manager.
  3. Start your web page public_html(or the document root of the domain from which the source files originate from).
  4. Click Choose All, located at the top of the screen.
  5. Press the Ctrl-Click the key to select (un-selecting) the folders or files in the public_html folder of your computer:
    • CGI-bin
    • .qidb
    • addon domain directory
  1. After the files have been highlighted After the files are highlighted, click Copy on the top menu of the in the top menu of the Manager. A pop-up will be displayed in the top menu of the File Manager, showing the path to the file:
  2. /public_html
  3. In the box, type into the field the domain name for the domain directory where you’re copying the files. The package will now appear like this:
  4.  /public_html/ 
  5. Change with your actual domain name.
  6. Click Copy File(s).

If you’re unfamiliar with this feature, you can read about it here. File Manager and want to know more about using it, you can read the following article:

  • Navigating the File Manager

Step 2: Create A New MySQL Database

Once the files are transferred to your addon domain directory, you can open your MySQL(r) databases in the cPanel and create a brand new MySQL Database.

Step 3: Modify the wp-config.php File for Your New WordPress Site

To modify the wp-config.php to work with WordPress:

  1. Log into the cPanel’s File Manager in your cPanel.
  2. You can go to public_html to discover public_html to locate the wp-config.php file. (If you are using different domains, you can access the site’s root document. ).
  3. Right-click on the wp-config.php and click Edit From the menu. You can also choose the icon in the menu. wp-config.php the file, and then click the file and then click on the Edit icon that is located near the top.
  4. A dialog box could pop up asking about encryption. Click Edit Continue. To continue, the editor opens a brand new window.
    • A new page will be opened for you to edit the information to reflect the new values associated with the new database that was created in Step 2.DB_NAME
    • DB_USER
  1. Click Save Changes.

Your wp-config.php file is now displaying your correct name of the database, user name, and database password. This is crucial for WordPress to determine which database to get the details from.

Step 4: Export the Database

The primary domain can export the databases and transfer them to the new database. For assistance with this procedure, please read these articles.

  • Export a MySQL Database via phpMyAdmin
  • How to Import Your MySQL Database

Step 5: Update the Database

The database settings need to be changed to reflect the updated details about the domain’s name.

  1. Look for the Databases section, then click on the PHPMyAdmin.
  2. On the next screen On the next page, select the newly created database’s name.
  3. Click wp_options.
  4. Click Edit on the Site URL and Home URL line.
  5. Change the option_value. Add your new domain name, or you can make use of it to register a Temporary URL If your addon’s domain isn’t pointing to HostGator at this time.
  6. Go to Save the Changes. “Go” for saving the modifications.
  7. Select to edit on the blog’s name line.
  8. Change the name of your blog to reflect the new blog name.
  9. Click Go.
  10. Make sure to click to edit on the blog’s description line.
  11. Modify the description of your blog to reflect the new blog.
  12. Click Go.
  13. In the navigation panel to the leftClick wp_users.
  14. Click Edit on the user_login Line, and alter the username in order to show a different user name of your choice.
  15. On the Line for user_nicename, make sure to change the username there, too. For security reasons, Do not use Admin as a username.
  16. On the Line for user_pass, Highlight and erase the characters that are already in the box.
  17. Select the downward arrow. choose MD5. Create the password you want to use.
  18. Click Go.


Leave a Reply