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 be 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 is Cloning?
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 the 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.
First (and Fastest) Method: Site Cloning 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.)
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.
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.
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.
How to Delete the Cloned Site
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.
Alternative Method: Cloning a WordPress Site Using a Plugin
For this method, we are going to use a popular clone and migration plugin called Duplicator, which is 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.
Create a Copy of Your WordPress Site and Download It
The first thing you want to do is install and activate the Duplicator plugin from the plugin’s page in your WordPress admin area.
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.
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.
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.
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:
[ht_message mstyle=»info» title=»» show_icon=»» id=»» class=»» style=»» ]https://ggexample.com/clone/installer.php[/ht_message]
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.
Keeping the Backup File
There’s no problem leaving the backup ZIP file on the original site. It’s the same as storing a backup on the original server, as many plugins will do. For someone to be able to clone the site, he or she would have to know the precise filename and location of the file.
If that were the case you may have bigger problems than someone stealing the backup. You may want to consider security plugins to protect your data even if you don’t keep the backup file.
This is perhaps one of the easiest methods I have come across for cloning a WordPress website. It’s simple, effective and doesn’t take a lot of time to complete. Before you pay for services to transfer content, give this tool a try. It may save you a lot of money and time.
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. UpdraftPlus 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 clicks of a button.
All-in-One WP Migration: Easily export 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: They use 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: 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.
I hope this article showed you how easy it can be to clone a WordPress site in only a few steps. There are several great options for doing this, you just need to look into them and find out which one you prefer.
What kind of methods do you use to create backups and clones or your WordPress sites? Have you experienced problems moving or cloning your WordPress site from one location to another?