How to Duplicate a WordPress Website
WordPress is a popular content management system, and many users will attempt to copy their installation at some point for troubleshooting or design purposes.
If you do not feel confident manually duplicating your WordPress website on your own, Pro Design Live can be purchased on a monthly subscription. Call our 24/7 support staff at 888-401-4678 or Chat with them to learn more.
There may come a time when you need to duplicate your WordPress site's content and use it on a different domain name. Perhaps you are promoting a product known by more than one name, and you would like to have separate domains for each product name.
Instead of designing a new site for each and every domain, you may choose to use the content that already exists in one of your current domains. The following article will guide you through duplicating a WordPress site.
Important: Please be aware that the following steps are highly sensitive; it is highly recommended that you make a full backup of your website before proceeding with the steps in this article.
Why Do You Need to Clone Your WordPress Website
There are several reasons why you might need to duplicate a WordPress website. Let's break down each reason:
-
Development and Testing: Before implementing major changes or updates on a live website, it's often wise to test them on a duplicate site. This ensures that any potential issues can be identified and resolved without affecting the live site.
-
Backup and Disaster Recovery: Having a duplicate of your website serves as a backup in case something goes wrong with the live site. If your live site experiences a crash or data loss, you can quickly restore it from the duplicate.
-
Staging Environment: Duplicating a WordPress website allows you to create a staging environment where you can experiment with new themes, plugins, or design changes without affecting the live site. This helps to ensure that any changes made are compatible and function as intended before going live.
-
Migration to a New Server or Host: When moving your WordPress site to a new server or hosting provider, duplicating it first allows you to set up and test everything on the new server without disrupting the live site. Once everything is confirmed to be working correctly, you can then switch over the domain to the new server.
-
Cloning for Client Sites: If you're a developer or agency building multiple WordPress sites for clients, duplicating a base site template can save time and effort. You can then customize the duplicate to fit each client's specific needs, without starting from scratch each time.
-
Content Creation and Collaboration: Duplicating a WordPress site can also be useful for content creators or teams working on collaborative projects. Each member can have their own duplicate site to work on without interfering with others' work or the live site.
- 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
Step 1: Copy Files to the Folder/Directory of the New Domain
To add a new domain, follow the steps below:
- Log in to your Bluehost Account Manager.
- Once logged in, find and click the Hosting tab on the left side of your Account Manager dashboard.
-
Choose the Hosting Package name you want to manage under the All My Hosting Packages section.
-
If you have multiple Hosting packages on your account, click the MANAGE button on the Hosting package you want to manage.
-
If you only have a single Hosting package on your account, you will be rerouted to the Hosting Overview page.
-
- Click on the File Manager button under the Quick Links section.
- Open the public_html folder.
- Along the top of the screen, click Select all.
- Press and hold the Ctrl key while clicking (un-selecting) the following folders in your public_html folder:
- .qidb
- cgi-bin
- addon domain folder
- With the files still highlighted, click Copy in the top menu of the File Manager. A pop-up will open showing the following path: /public_html.
- Type the name of the addon domain folder to which you are copying the files. This box should now look similar to /public_html/addondomainname.com. (Replace addondomainname.com with the actual domain.)
- Click Copy File(s).
Step 2: Create a New MySQL Database
Once the files have been copied over to your addon domain folder, on another screen, open the MySQL Database Wizard in cPanel. This is where you will need to create a new MySQL database.
Step 3: Edit the WordPress wp-config File for your New Site
To edit the wp-config.php file for WordPress, follow the steps below:
- Log in to your Bluehost Account Manager.
- Once logged in, find and click the Hosting tab on the left side of your Account Manager dashboard.
- Choose the Hosting Package name you want to manage under the All My Hosting Packages section.
-
If you have multiple Hosting packages on your account, click the MANAGE button on the Hosting package you want to manage.
-
If you only have a single Hosting package on your account, you will be rerouted to the Hosting Overview page.
-
- Click on the File Manager button under the Quick Links section.
- Open the public_html folder and locate your addon domain folder.
- Right-click on the wp-config.php file and click Code Edit or Edit button.
- When this page opens, edit the following information to reflect the values assigned to the new database created in the previous step.
- DB_NAME
- DB_USER
- DB_PASSWORD
- Click the Save Changes button.
Your wp-config.php file should now reflect the correct database name, database user, and database password. This is essential for WordPress to know which database to obtain the information from.
Step 4: Export the Database
Export the database from the primary domain and import it into the newly created database. For help with this process, please refer to the following articles:
Step 5: Update the Database
The database settings must be updated to reflect the new domain name information. To edit the database settings, follow the steps below:
- Click on the cPanel button under the Quick Links section.
- In the cPanel home page, navigate to the Databases section and click the phpMyAdmin icon.
- In the left navigation panel, click on the newly created database name.
- Select the wp_options table. For instance, we have 'example_options'
- Click Edit on the siteurl line.
- Change the primary domain name to the addon domain name, then click Go.
- Click Edit on the blogname line.
- Change the blog name to reflect your new blog, and click Go.
- Click Edit on the blog description line.
- Change the blog description to reflect your new blog, and click Go.
- In the left navigation panel, click wp_users.
- Click Edit on the theuser_login line and change the user name to reflect your choice's new login username.
- On the user_nicename line, change it there as well. For security purposes, do not use Admin as either username.
- On the user_pass line, highlight and delete the characters already in that box.
- Create a new password of your choice.
- To the left of that is the varchar(64) box; click the down arrow and select 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 now be able to log in to your newly imported WordPress site.
Step 6: Update the Database Tables
Once the domain is working, and you can log in to the WordPress Dashboard of the new site, install the Search and Replace plugin. It will allow you to search all of the tables in the database, search for your old domain, and replace each instance with your new domain. You can uninstall the plugin after the tables have been updated. In addition to the database, you should check your site for any links hard-coded into widgets, etc. Those links will need to be manually edited to reference your new site address.
For additional information on using this plugin, please review the following article: Using the Better Search and Replace Plugin
Step 7: Update WordPress
- Log in to your WordPress Dashboard.
- In the left navigation menu, go to Settings.
- Click General.
Be sure that each of the following fields displays your new domain name and not the old one:
- WordPress Address (URL)
- Site Address (URL)
Summary
This guide teaches you how to easily duplicate a WordPress website for backups or migrations with our step-by-step guide. Duplicating is crucial for development testing, backups, and migration purposes. Follow our straightforward process, including copying files, creating a new MySQL database, editing the wp-config file, exporting/importing the database, updating settings, and using the Better Search and Replace plugin for domain changes.
Ensure a seamless transition by updating WordPress settings. You can also further boost your WordPress site's performance by using a WordPress Hosting.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.