How to Clone a WordPress Site (Complete Guide)
A clone is a person or thing that is an identical copy of another. Regardless of your thoughts on animal (or even human) cloning, cloning a WordPress site, i.e., making an exact copy of it, can be useful in certain scenarios and doesn’t raise any ethical issues. If you want to learn how to clone a WordPress site, you’ve come to the right place.
TL;DR: duplicating a WordPress site on your own can be cumbersome and takes a non-trivial amount of time and effort. The best way to copy a WordPress site is to use BlogVault. It can make an exact copy of your website in seconds and with only one click of a button. Moreover, once you’re done experimenting with the cloned site with the staging feature, you can easily push the changes to your production site from the same interface.
What is WordPress cloning?
As I mentioned earlier, WordPress cloning simply means creating an identical copy of your WordPress site to test changes, move a WordPress site to root, etc;. Technically speaking, when you back up your website, you create a ‘clone’ of it and store it somewhere. However, that’s not what we mean when we talk about cloning in the context of websites. For us, the term means creating an exact, fully operational copy of a website in a particular location; that is, a website that behaves just like your production site.
In contrast, when you back up a site, you create an ‘inactive’ copy of it as a safety net. Now, there might be a few reasons why you may want to clone a WordPress site, reasons that I’ll describe in detail later in the article. For now, let’s fire up the WordPress Site Replicator 3000 (WSR-3000) cloning machine!
How to clone a WordPress site using a plugin
Using a staging plugin to clone a WordPress site is the easier of the two methods I’ll describe in this article. A plugin can save you a lot of time and effort vis-à-vis doing it yourself. For this article, I’ll use the excellent BlogVault plugin to demonstrate the process to clone a WordPress site without access to FTP. Using its staging feature, you can quickly make a password-protected clone of your website.
You don’t need to worry about creating a subdomain or performing a WordPress migration, and you don’t need to pay for additional hosting for the clone. BlogVault will host the cloned site on its own, powerful cloud-based servers. Moreover, it’s very easy to use and comes with a clean, minimalist UI. Here are the steps:
- As soon as you’ve signed up, BlogVault will start taking a backup of your site automatically. Once the backup is complete, go to the dashboard and under the Staging section, click on Add Staging.
- On the next page, choose the version of your site that you want BlogVault to clone as well as the PHP version. This is one of the many USPs of BlogVault. It stores multiple backups of your site, giving you the flexibility to test things on older versions of your site up to a year ago. Click Continue to proceed.
- BlogVault will now start the site clone setup process. On the next page, you can see the progress it has made. Once the process is complete, it will notify you and present you with a set of credentials for accessing the cloned site. These credentials ensure that you, and only you, will be able to access the site. Click on Visit Staging to access the clone it just created.
Congratulations! You now have an exact, fully operational copy of your WordPress site that you can experiment with. To access the cloned site’s dashboard, go to the URL that you get by appending /wp-login.php to the staging site URL. Note that you have to enter the same WordPress login credentials that you use for your live site to access the cloned site’s dashboard as well.
If you made some changes to your cloned site and want to replicate them on your live site, you can do so by going to the BlogVault dashboard and clicking on Merge in the Staging section.
How easy was that? You see, BlogVault is the best way to clone a WordPress site. Besides being quick and easy to clone a site with BlogVault, here are some other reasons why you may want to choose BlogVault over other methods:
- It automatically prevents Google and other search engines from crawling the cloned site, which would otherwise affect SEO performance due to duplicate content.
- You don’t need to pay for additional hosting. BlogVault will host the cloned site on its own, powerful cloud-based servers.
- SSL support for the cloned site.
- It password-protects your cloned site.
- Many business-critical websites have email sequences that are triggered based on certain events. BlogVault automatically blocks all emails from being sent out from clones of such sites, so you don’t need to worry about unintentional emails.
- Every cloned site gets SFTP access for secure file transfer.
- The cloned site gets phpMyAdmin support, so you can carry out any database operation easily.
How to clone a WordPress site manually (Without a plugin)
You don’t have to use a plugin to clone a WordPress site if you don’t want to. If you’re a DIY person, you can do the cloning yourself. However, note that the manual procedure isn’t as simple, will take a lot of time, and is error-prone. Moreover, unlike using BlogVault, you’ll need a spare domain name and access to a server, either web-based or local, to host the cloned site. Therefore, I urge you to give BlogVault a try before proceeding. It will save you a lot of time and effort.
Here are the steps to manually copy a WordPress site:
- Create a copy of your site files and download it to your computer.
- Upload the copy to a web server.
- Export your live site’s database.
- Set up a database for your site’s clone.
- Import your live site’s database into the clone’s database.
- Edit the wp-config.php file
For this section, I’ll use FTP, a protocol that defines how files should be transferred over the Internet. To use FTP, you need an FTP client. I’ll use FileZilla, which is easy to use and pretty popular. Let’s get started.
Step 1. Create a copy of your site and download it to your computer
To create a local copy of your live site, you’ll essentially download the directory where you installed WordPress. This directory is usually public_html or www by default.
- Connect to your live site in FileZilla using your FTP/SFTP credentials.
- Navigate to the directory where you want to download the copy of your live site in the left-hand pane labeled Local site.
- Download the root directory of your live site, where you installed WordPress, to the local directory mentioned in the step above.
Depending on the size of your live site, it will take quite a while for FileZilla to download all your WordPress files and folders. In my experience, I’ve found FTP to be agonizingly slow, which is another reason to use BlogVault for cloning instead.
Step 2. Upload the copy to a web server
- Connect to the web server that will host your site’s clone.
- Upload the directory that you downloaded in Step 1 to the server’s root directory.
Step 3. Export your live site’s database
To export your live site’s database, you’ll first need to launch the corresponding database manager. The two most common ones are phpMyAdmin and Adminer. I’ll use Adminer to illustrate the steps in this section. The steps are essentially the same for phpMyAdmin.
- Open the Adminer dashboard for your live site. It should look something like this:
- Click on Export from the left-hand pane.
- Select ‘save’ as the output, SQL as the data format, and then click on Export.
- In the pop-up window, give the SQL file a suitable name and download it to your computer.
Step 4. Set up a database for your site’s clone
Every WordPress site needs a database to store its content and settings, and your site’s clone is no exception. In this step of the cloning process, I’ll set up a new database for my live site’s clone. To illustrate this process, I’ll use Bluehost. The steps should largely be the same for any other web host.
- Go to Advanced > Databases from the left-hand navigation menu.
- Under the section ‘Create New Database,’ provide a name for your new database, then click on Create Database. In my example, I’ve named the database ‘mybhsite_home_for_new_database.’
- Now, we’re going to add a new database user for our account. Scroll down to ‘Add New User’ under ‘MySQL Users.’ Choose a username and a strong password for this user, then click on Create User to finish.
- Now, add the user you created in Step 3 to the database you created in Step 2 as shown in the image below.
- On the next page, assign all privileges to this new user and then click on Make Changes.
Step 5. Import your live site’s database into the clone’s database
I’ll use Adminer again to illustrate the steps.
- Launch the database manager of your website clone’s web host.
- Select the database you created for your site’s clone, then click on Import.
- Choose the correct SQL file to import, and then click on Execute to start importing.
It can take a while to import the data if your live site’s database is huge. After a successful import, you’ll see a confirmation message.
Step 6. Edit the wp-config.php file
The wp-config.php file is a critical file of your WordPress installation. It is located in the root directory of your website and contains your website’s base configuration details, like database connection information. This file is what WordPress consults to communicate with the database. So, if it isn’t configured with the correct database information, a visitor won’t be able to access the site.
In this step, you’ll modify the wp-config.php file so that it contains the correct database information.
Navigate to the cloned site’s root directory from the ‘Remote site’ area of FileZilla, then download the file. Modify the following lines of code with the new server’s MySQL database credentials:
define('DB_NAME', 'new database name here'); define('DB_USER', 'username for the new database'); define('DB_PASSWORD', 'password for the new database'); define('DB_HOST', 'new MySQL hostname');
Next, add the following lines of code below the line that says “That’s all, stop editing! Happy publishing.”, replacing “newdomain.com” with the correct domain of your cloned site:
define('WP_HOME', 'http://newdomain.com'); define('WP_SITEURL', 'http://newdomain.com');
Save the file and re-upload it to the root directory of your cloned site in FileZilla.
And that is it! You now have a fully operational clone of your live site.
When and why you should copy a WordPress site
There can be several reasons why one may want to duplicate a WordPress site. I list some of the common ones below:
- You want to install or update plugins and themes without the risk of breaking your site. It’s especially useful for plugins and themes that haven’t been tested for compatibility by their developers.
- You want to move your site to a new domain name or a web host. In this case, cloning your site will speed up the migration process.
- You’re developing a site for a client on your own computer or server. After you’ve finished, you can simply clone the website on the client’s web server.
- You want to create a staging site for your production site so that you can work on a redesign or make significant changes without affecting the experience of your readers.
Regardless of your reason to clone a WordPress site, note that it can be a slow, headache-inducing process if you go about doing so on your own. You can save a lot of time, effort, and potential headaches if you choose BlogVault. With BlogVault, you can clone your site easily in a few clicks. Moreover, it also allows you to selectively replicate any changes you made to your cloned site at your production site with a single button click.
Q – What is the easiest way to copy a WordPress site?
A – The easiest way is to use BlogVault, an excellent plugin with which you can