There are many reasons you may want to create a clone of a WordPress site. From backups to moves, cloning can help you be more productive as a developer. The trick is making sure the entire website has been copied.
Otherwise, you may find that important files are no longer available when you need them.
In this tutorial, I’m going to show you a couple of different ways to clone a WordPress site. From image files to databases, all the data related to your content can be easily duplicated as a result of using the right tools.
What Does It Mean to Clone A WordPress Site?
The first question we should answer is what is cloning? Cloning is creating an exact duplicate of a website. The clone should be identical to the original website.
However, each copy of the site is independent. So if you clone site A, any changes you make to the clone, site B, only show up on site B. You can begin to see the benefits already.
Experiments or changes are done on the cloned copy of the original site and do not affect (or break!) the original site.
Cloning requires access to the site’s root directory and database. So you’ll need access to those parts of WordPress in order to clone the website.
When Should You Clone a WordPress Site?
When a website is cloned, you have an exact copy of the images, content, plugins, and everything else, all duplicated perfectly. The cloned site will operate exactly as the original with the exception of the domain name. So what are some of the uses for a cloned website?
Creating a Staging Area
Perhaps you want to develop plugins, themes, or make modifications to the site in a testing environment. Instead of subjecting your primary site to the dangers of experimenting, the clone can be used as a WordPress staging environment. Some developers do this on a subdomain.
Working as a WordPress Developer
Some WordPress developers create clones for clients. Once the website development is completed, it’s easy to clone the site to the client’s hosting service. That provides a safe environment to make adjustments without fear of breaking a plugin or theme.
Creating a Backup
Creating a backup of your site can be useful. For one thing, it makes it easy to recover in the event of a disaster such as hacking or malware attack. The only downside to this is that you need to make regular clones to keep your backup files current.
Moving the Website to a New Host
Making a WordPress move from one host to another can be a complicated process. Cloning the site gives you the opportunity to make the transition without impacting visitors. Ideally, from the visitor’s perspective, no one will even know a move took place.
Now you can understand why you may want to clone a WordPress site. Let’s take a look at how you can get it done in a few simple steps.
How to Clone A WordPress Website
WordPress has no shortage of options when it comes to making a clone or your site. Here are several of the most popular ways to create a usable clone of your website.
Method 1: Clone WordPress Using Softaculous
If you have cPanel and you used Softaculous to install WordPress, cloning a WordPress site couldn’t be easier.
(If you have access to Softaculous but didn’t use it to install WordPress, you can still import your existing WordPress installation into Softaculous with just a few clicks.)
Step 1: Create a Staging Site (Clone)
The Softaculous Apps Installer calls cloning «staging» but rest assured, both of these are identical. The good news is that this is pretty easy to do and only takes a few clicks.
Log in to cPanel.
In the «Softaculous Apps Installer» section, click the «WordPress» icon.
In the «Current Installations» section, click the «Create Staging» icon. Softaculous uses the term «staging,» which, for our purposes, is the same as a «clone» of the site.
This will open the «Staging WordPress» window. Here, you can determine the barebones of your installation.
Live Installation URL is the WordPress installation that will be cloned.
Choose Installation URL
- Choose Protocol
You can choose HTTP or HTTPS, with or without www. Choose whatever matches the live site.
- Choose Domain
If you have multiple domains, choose the same domain as the live site. You can also select a subdomain if you have one set up.
- In Directory
Enter the name of the directory where you want the clone site to be set up. If the directory doesn’t exist, it will be created automatically.
Database Name – you can leave whatever default value is entered here unless you have a specific need to name the database a certain way.
Click the «Create Staging» button.
You’ll see a success message.
That’s all there is to it. Your cloned site is ready to go.
Step 2: Using the Cloned Site
Log in to /wp-admin on the cloned site using the same username and password as the live site. Make your changes to the cloned site, and if you’d like, when you’re satisfied that everything is working properly, you can «push» the cloned site to the live site.
«Pushing» just means replacing the live site with the cloned version. There are a couple of different ways to do that.
In the «Current Installations» section of Softaculous, click the «Push to Live» icon on the staging site line.
The first method is to use the default options. The default options replace everything on the live site, files, and database, with the versions that exist on the cloned site.
The system creates a backup of your live site before replacing it, so if anything were to go wrong, you will have a backup.
Clicking the «Customize» tab will allow you to push only certain database tables. You should only choose this option if you’re sure of what you’re doing and comfortable with pushing incremental or partial changes.
Most of us will use the default options.
Step 3: Delete the Cloned Site (When Your Done)
Since it’s so easy to clone a site there isn’t any reason to keep it around when you’re finished using it.
To delete the clone site and database, go to the «Current Installations» section of Softaculous and click the “X” icon on the staging site line.
To completely remove the staging site, leave all of the options selected.
Click the «Remove Installation» button.
Method 2: Clone a WordPress Site Using a Plugin
For this method, we will use a popular clone and migration plugin called Duplicator, a WordPress migration plugin. There are several plugins that can clone WordPress sites, and I’ll list a few more options in a minute.
Duplicator creates two files from your WordPress site: an archive file and an installer file. The archive contains copies of your site data and MySQL database. The installer is a PHP file that will extract and install the archive in the new location.
Here’s how you clone a WordPress site using the Duplicator plugin.
Step 1: Create a Copy of Your WordPress Site and Download It
Once the plugin has been installed and activated on your site click the «Duplicator» tab. This will take you to the main page of the plugin where you can create a clone.
Click the «Create New» tab to get started.
Enter a name for the file to help you identify it and click the «Next» button.
The Duplicator WordPress clone plugin will scan the site and let you know if there are any issues with your settings. It’s normal to get warnings, especially since everyone is using different versions of WordPress, PHP, etc.
There may also be some web host warnings based on the size of your site. Click the «Continue with the build process» checkbox, then click the «Build» button to keep going.
When your website package has been completed, you will see the page below and receive links to download two files: the Installer and the Archive.
Download both files to your computer.
Step 2: Upload the Copy of Your Site
Upload the two files to your new location or server. To do this, you will need to use an FTP Client. There are a lot of good ones available. If you don’t have one, I recommend FileZilla or Transmit (for Mac users) as an alternative.
Log in to the server (or directory on your existing server) where you want to set up the clone.
Drag and drop the two files into the target directory.
Step 3: Set Up a Database For Your Website’s Clone
Every WordPress website uses a database. Your clone is no different, so we need to set up an empty database. This will allow you to use the Duplicator installer to import the contents of your original site’s database to your new one. I’m using cPanel.
In cPanel, there are several options related to databases. Look for «MySQL Databases.»
Click it to create a new database. You need to create the database and then add a user. You will see both options available on the New Database page.
Now create a user.
And finally, add the user to the database.
Note: When you add the user to the database make sure you click the «All Privileges» checkbox.
Step 4: Finish the Clone
Now that you have added the database and both of the Duplicator files are on your server, you can access the new website through your browser.
Just add /installer.php to the URL, like:
Duplicator will run and will alert you of any problems and ask you to proceed. In most cases it’s safe to continue.
Duplicator will ask you to enter the database credentials that you created. Enter the details and Duplicator will import your old database into the new one.
Duplicator will ask you a couple more simple questions regarding permalink and structure updates as well as the URL path. The fields should be pre-filled, but you can complete them if they are empty.
Duplicator will do the rest, including deleting both the installer and the archive files. Just click through the prompts.
That’s it! You have now successfully cloned a WordPress site using Duplicator.
Note: That zip file you create when making a copy of your website is essentially a backup of your website. It is worth hanging onto it just in case anything happens. This will ensure you have a backup to restore your website in the event that something goes wrong.
Other WordPress Clone Plugin Options
If you are interested in other WordPress clone plugin options, here are a few more to look into and consider. They all get the job done, it’s just a matter of preference.
UpdraftPlus makes WordPress backups and restoration very simple and easy. It is actually the highest-ranking and most popular backup plugin in the WordPress repository. You can back up your files and database into the cloud and then restore them with a couple of clicks of a button.
All-in-One WP Migration
All-in-One WP Migration easily exports your WordPress website and database without needing a lot of technical knowledge. You can upload your WordPress site to a different location using a drag and drop technique. This plugin also has a «find and replace» option that will automatically fix any problems that occur while using the plugin.
BackupBuddy uses a specific 5-step plan for backing up or cloning WordPress sites. With just a few clicks, BackupBuddy backs up your entire WordPress website from within the WordPress dashboard. There is no free version of this one, but it’s a very solid WordPress clone plugin.
WP-Migrate DB is perhaps just a solid as anything else mentioned above is WP-Migrate DB. You can export your database as a MySQL data dump (much like phpMyAdmin), do a find and replace on URLs and file paths, handle serialized data and then save it to your computer as an SQL file.
The main big drawback of this WordPress clone plugin is that the pro version is very expensive and you might have to buy it in order to do everything you want if you’re a developer.
Method 3: Using Your Hosting Account
Many web hosts provide a variety of additional tools that customers can take advantage of. At GreenGeeks, we offer simpler solutions than many others and added a staging area directly from your account desktop.
You may have the option to create a clone directly through these options, but it is entirely dependent on your web host.
If your web host does not offer these features, it might be time to switch to a better one.
Note: Even if you web host does support this feature, how you access it may be different.
Step 1: Locate the Staging Option
The first thing you need to do is actually find the option. Begin by logging into your web hosting account. Once there, click on the Hosting option.
Click on the domain you want to clone. After that hover over the WordPress option and select the Staging option.
Step 2: Create A Staging Environment (Clone)
You’ll now see a full list of the domain and all of the subdomains. This even includes the ones that do not have WordPress installed on them. Locate the one you want to clone and click on the three verticle dots on the right of it.
Click on the Create Staging option.
A small pop-up box will appear. It has four pieces of information that you need to fill in, but half of it should already be good to go. In the Directory text box, type «dlr» to satisfy it.
Simply name the site and click on the «Create» button.
Afterward, you should see a message stating that the staging was successful. Reload the page to see it at the bottom.
Step 3: Access Your Cloned Site
Then, click on the link and you can begin interacting with your site’s clone. It will have identical admin information, so the login will be the same as your main site.
It’s Easy to Clone A WordPress Website
Creating a clone of your WordPress website has never been easier. Between a plethora of plugins and options like Softaculous, you have no shortage of options to consider.
It’s an extremely useful feature that allows you to test changes without impacting your live site. Taking the time to set one up can be the difference between success and failure.
What kind of methods do you use to create backups and clones for your WordPress sites? Have you experienced problems moving or cloning your WordPress site from one location to another?