At some point while using WordPress, you’ll probably encounter a situation in which you need to clone a WordPress website. You might need a safe environment to test new features in, or perhaps you’re planning to move your website to a new host. The question then becomes…how do you make sure the cloning process goes off without a hitch?
That’s what we’re going to tell you in this post! To do it, we’ll use a free plugin called Duplicator. This tool will enable you to create fully operational copies of your WordPress website and set them up on any web server that supports WordPress.
Because of how easy Duplicator makes it to clone a WordPress site, it’s the perfect solution for creating staging sites, changing your domain name, or even migrating your site to a new host.
In this article, we’ll dig a little deeper into the reasons why you’d want to clone a WordPress website. Then, we’ll teach you how to do it in four simple steps using Duplicator. Let’s fire up the cloning machine!
Why you’d want to clone a WordPress website
First, let’s talk about what the term ‘cloning’ means in this context. Cloning your site is different from backing it up. Cloning involves creating a fully operational copy of your site that’s set up in a specific location, whereas backing up your site results in a ‘dormant’ copy of your site’s files that can be stored anywhere for safekeeping.
Cloning your WordPress site can come in handy in a number of ways, including:
- When you need a staging website: Testing major updates live is risky business, and having a clone of your site enables you to ensure any changes run smoothly before updating your live site.
- For migration purposes: If you’re looking to change web hosts, you can take your WordPress site and set it up exactly as it was before on a new server.
- Changing your domain name: Changing your domain name involves, partially, “cloning” your site to a new location on your server
How to clone a WordPress website using Duplicator (in four simple steps)
Before moving on to the first step, you’ll need to set up an account at a different web host or create a local environment where you can host your site’s clone. However, don’t go ahead and set up WordPress there yet – we’ll take care of that together during the cloning process.
Step #1: Create a copy of your site and download it
A Duplicator ‘package’ consists of a pair of files that enable you to set up a clone of your website on a new server using a standalone installer. The plugin lets you create as many of these packages as you want. All you have to do is enter a name for identification purposes, and then click on Next:
At this stage, Duplicator will let you know if there are any issues with your settings. It’s normal for a warning or two to pop up here, depending on your web host and the size of your site. If this happens to you, just check the box that reads Yes. Continue with the build process! at the bottom of the page and then click on Build:
Now give the plugin some time to work its magic. When the process is done, you’ll get the option to download the two files we mentioned earlier:
Download them to your computer as you would any other file and keep note of where they’re saved – we’ll need them again in a moment.
Step #2: Upload the copy of your site to your server
The next step is to upload both of the files you downloaded to your new server. To do this, you’ll want to use an FTP client. If you don’t have one set up yet, we recommend FileZilla.
You’ll need to log into your new server via FTP using the credentials you obtained when you signed up to the corresponding web host:
Once you’re in, copy both files to your server’s root directory – which is usually called either
public_html – then proceed to the next step.
Step #3: Set up a database for your website’s clone
Every WordPress website needs a corresponding database to store its information, and your clone is no exception. In this step, we’re going to set up an empty database where your cloned site will reside in preparation for step number four. That way, we’ll be able to use the Duplicator installer to import the contents of your original site’s database to your new one.
If you’re using a regular web host, you’ll find several options related to databases within your cPanel. We’re looking for the one that reads MySQL Databases:
Once you’re in, look for the section to create a new database. Pick a name (something related to your website, preferably) and confirm your choice by clicking on the Create Database button:
Now, scroll down further until you find the Add New User section. Pick a name for your user and a password, then confirm your choice. Now, head to the option that reads Add User to Database, locate the user you just created, and select your new database from the drop-down menu:
At this stage, the tool will ask you to confirm which privileges you want your new user to have. Make sure to tick the option that says All Privileges, which will grant full access. Now, save the name of your database and your user’s information – you’ll need it in a minute.
Step #4: Run the Duplicator installer and finish the cloning process
Now that both files are on your root server, access your new website through your browser and add
/installer.php to its URL, as in the example below:
This will enable you to access the installer file you downloaded during step #1 and get the cloning process started. At this stage, Duplicator will tell you if there are any problems with your files and ask for confirmation that you want to proceed.
After you click on Next, Duplicator will take a while to unpack your files. When it’s done, it will ask you to enter the details for your new database. Click on Next when you’re ready, and the plugin will import your old database into your new one:
Finally, Duplicator will ask you to confirm your ‘new’ site’s URL, installation path, and title. Fill these fields out and click on Next one final time:
To wrap things up, the installer will ask you to update your permalink structure, test that your cloned website is working correctly, and delete both the installer and the archive files. To do so, click on each of the buttons it shows you in order and let Duplicator do the work for you:
Afterward, you can pat yourself on the back. You’ve learned how to clone a WordPress website!
Cloning your WordPress site might sound like a tall order, but it’s really nothing you need to be scared of. While there are a few extra steps involved, there are no insurmountable challenges and Duplicator makes the majority of the process as simple as clicking a few buttons.
Remember – this is all it takes to clone a WordPress website with Duplicator:
- Create a copy of your site and download it.
- Upload the copy of your website to your new web host.
- Set up a database for your website’s clone.
- Run the Duplicator installer and finish the cloning process.
Do you have any questions about how to clone a WordPress website with Duplicator? Ask away in the comments section below!