Do you want to clone a WordPress website?
Cloning an existing WordPress site is often the first step when moving to a new host, starting a client development project on a localhost, setting up a staging website, and more.
In this article, we will show you how to easily clone a WordPress site.
What Is WordPress Website Cloning, and Why Use It?
The idea behind cloning a WordPress website is that you make an exact copy of one site and apply it to another site.
There are many reasons why you might need to clone a website. For example, you might be moving a site to a new host or a new domain name. By cloning a website, you can save a ton of time and effort and complete the migration process much faster.
Another example is developing a website for a client on your own localhost. Once the work is complete, you can simply clone the site and move it to the client’s live server.
You can also clone a live WordPress site and set up a staging site to test changes before making them live.
With that said, let’s show you how you can clone a WordPress site in a few easy steps.
Step 1: Set Up the Duplicator WordPress Plugin for Easy Cloning
The plugin backs up everything from your website into a single file, which you can simply move to the new location.
The first thing you need to do is activate and install the plugin on the website you want to clone. For more details, see our step-by-step guide on how to install a WordPress plugin.
Note: There’s a pro version of Duplicator that has additional features like scheduled backups, multisite migration, and more. However, we will use the free version for this guide as it has everything you need to clone a WordPress website.
Step 2: Create a Duplicator Package of Your WordPress Site
Upon activation, go to Duplicator » Packages and then click on the ‘Create New’ button at the top of the page.
After that, you will be taken to a screen where you can type in a name for the duplicate file. This is just for your reference, so you can use anything you want.
Then, click the ‘Next’ button.
Duplicator will now scan your site. If it finds an issue with any part of your WordPress website, then you will see a warning with information on how to fix the problem.
When you see the ‘Scan Complete’ message, just click on the ‘Build’ button to continue.
The plugin will now back up your WordPress database, images, templates, plugins, and all other files in a single downloadable package.
Depending on your website’s size, the process might take a couple of minutes.
Step 3: Prepare to Clone Your WordPress Site
Once the backup process is finished, it’s time to download your files.
You need to download both the archive file, which contains your backup, and the installer that will unpack the archive.
To do this, go ahead and click on the ‘One-click Download’ link.
Step 4: Upload Your WordPress Site Archive and Installer to a New Location
Now you have a complete backup of your site and the installer file, the next step is uploading them to the new location.
This new location can be a live WordPress blog or a site on your local server. If the site is on a local server, then you will need to create a new folder in your local server’s root folder. This is the file where your local server stores all websites.
For example, if you are using MAMP, then it will be the ‘/Applications/MAMP/htdocs/’ folder.
Alternatively, if you are using WAMP, then it would be the ‘C:\wamp\www\’ folder.
After that, you need to open the folder you created for your cloned website and copy both the archive file and installer into that folder.
If you are using a live website on a different WordPress hosting platform, then you will need to upload the installer and archive to the root directory using an FTP client.
If you haven’t done this before, then see our beginner’s guide on how to use FTP to upload files to WordPress.
No matter where you upload the files, you need to make sure that the folder only contains your installer.php and archive zip files.
Step 5: Create a New WordPress Database for Your Website
Next, you need to create a new WordPress database to unpack your cloned version of WordPress. If you have already created a database, then you can skip this step.
There are a few ways to create a database, depending on whether the new location is a live site or a site on your local server.
If you are using a live site, then simply log in to your WordPress hosting account dashboard. Here, scroll to the ‘Databases’ section and select ‘MySQL Databases’.
This brings you to a screen where you can type in a name for your database.
Then, click the ‘Create Database’ button.
Next, you need to add a new user to the MySQL database.
Simply scroll to the ‘MySQL Users’ section. Then, type in a username and password for the new user, and click the ‘Create a user’ button.
Once you have done that, the next step is adding the user to your database.
Simply scroll to the ‘Add User to a Database’ section, and open the ‘User’ dropdown. Here, select the database user you created in the previous step.
After that, open the ‘Database’ dropdown and select the database you created earlier.
Make sure you take note of the database name, username, and password, as you will need this information in the next step.
With that done, click the ‘Add’ button.
If you are using a localhost installation, simply visit ‘http://localhost/phpmyadmin/ ‘ or ‘http://localhost:8080/phpmyadmin/’ in your web browser to launch phpMyAdmin.
After that, click on the ‘Menu’ tab, and then select the ‘Database’ option.
Next, you need to enter a new name for the database.
Then, just click the ‘Create’ button.
You will be using the database name in the next step. For most localhost installations, your host will be localhost, and the username will be root, with a blank password.
Step 6: Run the WordPress Website Importer Script
Now, all your files are in place, it’s time to run the Duplicator installer script. This script unpacks your archive file in a few clicks.
First, type your website URL into the web browser and add installer.php to the end of it. This will look something like ‘https://example.com/installer.php’. Make sure you replace ‘example.com’ with your own domain name or your site’s localhost address.
Next, the Duplicator installer script will appear on the screen. First, it will automatically look for existing backup files and the initial settings.
If there are no errors, then check the terms and notices checkbox at the bottom and click ‘Next’ to continue.
On the next screen, you need to enter your WordPress database information.
This is the database information that you copied above.
At the bottom of the page, there’s a ‘Test Database’ button you can use to check all your database information is correct.
If everything looks good, then click the ‘Next’ button.
Duplicator will now import your WordPress database.
As part of this process, it will automatically detect any changes and complete the ‘URL’, ‘Path’, and ‘Title’ fields for you. Simply click the ‘Next’ button to continue.
Duplicator will now finish the installation, and you will see the ‘Admin Login’ button.
Just click on this button to visit your new, cloned website.
Step 7: Test Your Cloned Website and Delete Temporary Files
You can now go ahead and test your cloned website.
We recommend testing both the WordPress admin area and your website’s public front end to make sure all your data is there, and the website is working as expected.
Once you are happy that everything is imported correctly, you can go ahead and delete the installation files created by the Duplicator plugin.
On your cloned WordPress site, go to Duplicator » Tools and then click on the ‘Remove Installation Files’ button.
That’s it, you have successfully cloned a WordPress site.
Closing Thoughts on WordPress Website Cloning
As you can see, cloning a WordPress site is not very difficult as long as you are duplicating your own website.
If you want to copy someone else’s WordPress site, then that’s actually illegal unless you have their explicit written permission.
There are other ways to clone a WordPress site, like doing it manually, which doesn’t require WordPress admin access. However, there are no benefits to manual cloning unless you are dealing with a really big website.
Most times, when you are cloning a WordPress site, we recommend using the above method because it’s the easiest and most comprehensive.
We hope this article helped you learn how to easily clone your WordPress site. You may also want to see our guide to the difference between a domain name and web hosting and our expert picks of the best email marketing services for small businesses.