There will be a point that you’ll need to duplicate your WordPress site’s content and then host it under an additional domain. You may be promoting an item that is known under multiple names and would prefer to have distinct parts for each brand name.
Instead of creating a brand new website for each domain, it is possible to make use of existing content in one of your existing domains. This article will walk you through duplicates of a WordPress website.
Note: Please be aware that the steps in this article are extremely sensitive. It is recommended to create a complete backup copy of your site prior to completing the steps described in this article.
- Step 1: Copy Files to the Folder/Directory of the New Domain
- Step 2: Create a New MySQL Database
- Step 3: Edit the WordPress wp-config File for your New Site
- Step 4: Export the Database
- Step 5: Update the Database
- Step 6: Update the Database Tables
- Step 7: Update WordPress
Note: Legacy accounts will feature a horizontal navigation bar at the top of the screen, while Bluerock account users will see a vertical navigation menu on the left-hand side of the screen. If you are still trying to decide what interface your account uses, please see Bluerock vs. Legacy to determine which step to follow.
Step 1: Copy Files to the Folder/Directory of the New Domain
To add a domain to your existing one, log in to the Bluehost Control Panel. Then complete the next steps for copying files to the new environment.
- Bluerock Account: Click on the Advanced tab on the menu of navigation to the side to the left. Then, beneath the File section, select the file manager.
- Older account Select select the Cpanel option in the navigation menu at the highest point of the screen.
- Scroll down, and then hit File Manager under the File section.
- Navigate to your public_html folder.
- At the upper part of your screen, select All.
- Hold and press the Ctrl key while you click (un-selecting) these folders of the public_html folder of your computer:
- addon domain folder
- If the files are still visible the files are highlighted, Click the Copy button from the menu at the top of File Manager. A pop-up will show the following URL: /public_html
- In the box, type your name in the box for the domain folder where you want to copy the files. This box should now look similar to /public_html/addondomainname.com. (Replace addondomainname.com with your actual address.)
- Click Copy File(s).
Step 2: Create a New MySQL Database
After the files have been transferred to the Addon Domain Folder, on a different screen, launch your MySQL Database Wizard within the cPanel. This is the place where you’ll have in order to create a brand new MySQL database.
Step 3. Edit the WordPress WP-Config File to accommodate your new site
To modify the wp-config.php file that WordPress uses, it is necessary to log in initially to the Bluehost Control Panel.
- Bluerock Account: Click the Advanced Tab from the side menu navigation to the left, and then under the File section, click on the File Manager.
- The Legacy Accounts: Click the cPanel option in the menu of navigation on the right side of the page.
- Scroll down, and then select File Manager under the File section.
- Navigate to your public_html folder, and then locate the domain addon folder.
- Click right-clicking on the wp-config.php file and click the code editor edit button.
- If this page appears, Edit the information to reflect the values that were assigned to the new database you created in the previous step.
- Click the Save Changes button.
Your wp-config.php file should now show the database’s correct names, user name, and password to the database. This is necessary for WordPress to determine which database to get the details from.
Step 4: Export the Database
Transfer the data from your primary domain and move it into the new database. To assist you in this procedure, please read this article:
- How do I import or export a database using PHPMyAdmin
Step 5: Update the Database
The settings in the database must be changed to reflect the latest details about the domain’s name.
- Log into the Bluehost Control Panel.
- Bluerock Accounts: click to open the Advanced tab on the menu of side navigation on the left. Please find it in the Database tab and hit the icon for phpMyAdmin. Icon.
- The Legacy Accounts: click the cPaneloption from the navigation menu located at the very top. Next, search for the Database Tools section.
- Within the right navigation area, click on the database that you just created. Click name.
- On the navigation left panel, select the wp_options button.
- Select Modify to edit the URL line.
- Make the change from the main domain to the domain name of the addon and then Click “Go.
- Select to edit to edit the blog name line.
- Change the blog’s name to reflect the new blog. Click to go.
- Select “Edit” on the blog’s description line.
- Modify the description on your blog to reflect the new blog, and then click to go.
- On the navigation left panel, select on wp_users.
- Click edit on the user_login line and then change the username to reflect the new login username.
- On the line for user_nicename, make sure to change the username there too. To protect yourself, don’t use Admin as the username.
- On the line for user_pass, mark and erase any characters already present in that box.
- Create an entirely new password of your preference.
- To the left there is to the left of that is varchar(64) box. Click the down arrow to choose MD5.
- Click Go.
You can test these changes by visiting http://yourblogname.com/wp-login.php (replace yourblogname.com with your actual domain name).
You should be able to login to your newly-imported WordPress website.
Step 6: Update the Database Tables
After the domain has been operational and you are able to access the WordPress Dashboard on the new website, install the Search and Replace plugin. It allows you to search all databases to find the domain you used to have and then replace each one with the new domain. It is possible to uninstall the plugin when the tables have been upgraded. Alongside the database, look over your website for widgets that have been hardcoded, or other widgets. These links must be manually modified to refer to the new URL.
For more information about using this plugin, please read this article Utilizing the Better Search and Replace Plugin
Step 7: Update WordPress
- Log into Your WordPress Dashboard.
- In the navigation menu left, Go to Settings.
- Click General.
Check that each of the fields below will show your domain’s new name and not the previous one:
- WordPress Address (URL)
- Site Address (URL)