How to Clone a WordPress Site in 5 Steps

Updated: 2022-04-14 / Article by: Nicholas Godwin
Cloning WordPress in 5 simple steps

As a site administrator or business owner, you might need to clone a WordPress website to save yourself the stress of building a site from scratch.

Also, WordPress site cloning would come in handy when migrating to a new host, changing a domain name, or creating a staging environment to test major updates.

How do you go through this process without a hitch? 

Thankfully, this article can guide you in five simple steps. But first, let’s explore what WordPress cloning is all about.

What’s WordPress Cloning?

WordPress cloning involves duplicating a functional and live copy of a WordPress website in a new location. It means to create an exact copy of a website on another URL or server. 

The process is similar to backing up a website, but they serve different purposes.

A backup creates a dormant copy of the website files for safekeeping. It helps web admins restore the website to its original state whenever it crashes, or anything goes wrong. 

But during cloning, web admins duplicate the files and upload them to a new location, allowing visitors to access a similar copy of the website via a new URL. 

Cloning a WordPress Website With Duplicator

Several plugins could help you migrate and clone your WordPress site. 

In this tutorial, we'll use the WordPress Duplicator plugin, a free and beginner-friendly WordPress plugin. It lets you backup your website into a single file in a few simple clicks, allowing you to clone your website quickly. 

Follow these five steps to clone any WordPress website when you're ready.

  1. Install Duplicator Plugin On Your Website
  2. Create and Export the Duplicator Package
  3. Upload the Duplicator Package to the New Location
  4. Create a New WordPress Database for the Website
  5. Run the Duplicator Package Installer

1. Install Duplicator Plugin On Your Website

Log in to the WordPress site you wish to clone. Click Plugins in the admin sidebar to reveal a drop-down menu, then select Add New to go to the plugin library or repository.

Add new WordPress plugin

Type duplicator on the search bar to find the plugin quickly. 

You should see the plugin on top of the search result. Click the Install Now button to get it into your plugin library.

Duplicator plugin

Activate Duplicator to complete step one. It's that simple. 

The plugin will be in your admin sidebar if you get everything correct.

Duplicator Settings

2. Create and Export the Duplicator Package

You’ll need to create a duplicator package of all your web content and files.

Click Duplicator in the admin sidebar to open all the packages. Don't expect to see anything there unless you have built a package in the past.

Now, click the Create New button build to create a duplicator package to clone your site.

clone

Enter a new name for the package. Leave the rest of the settings as-is and click the Next button.

duplicator - new package

Duplicator will scan your website for errors. Wait patiently as it does it work. The process shouldn’t take more than two minutes.

Duplicator scanning

Next, you'll get a comprehensive scan report covering setup, archive, and database. You can toggle the tabs to read the reports. Fix the errors or contact your host for assistance.

Click the Build button below the scan report to create your package.

Please check the box to continue with the build process if the duplicator plugin detected a minor notice status, like multisite or large file size, like in our case.

Please note that Duplicator doesn't provide support for WordPress multisite. 

You can upgrade to the pro version if you need assistance. However, following the steps here and Duplicator on-screen instructions will help you complete the process seamlessly.

Next, download your duplicator package to your local computer to complete step two.

3. Upload the Duplicator Package to the New Location

It's time to upload the archive and installer files to the new location.

You need to upload them to the new site's root directory (public_html folder) using an FTP client. You have a plethora of options to choose from. This WordPress FTP comparison resource can guide your decision.

Next, install your preferred FTP client, and log in to upload the files. If you don’t have login credentials, create an FTP account via cPanel or contact your host for assistance.

Open the public folder (root directory) and drag the duplicators file into the FTP client to upload them when you log in. Upload only into the public-facing folder, and ensure it's empty by deleting default server files.

Alternatively, you can get it done in a few minutes via cPanel without an FTP client. Log in to your cPanel, locate the Files section and click File Manager.

Scroll through the files at the side to locate the public_html folder. If you can't find the file, reach out to your web host for the exact path of your public folder.

Select and delete all the files to empty the public folder. Finally, upload the duplicator files to complete step three.

Make sure it's uploaded to the public folder.

4. Create a New WordPress Database for the Website

A WordPress site requires a MySQL database to function. So, you'll need to create one for your new site. Click MySQL Databases in the cPanel’s Databases section to begin.

Enter a name for the database and click the Create Database button to create a new database for the website.

Next, you’ll need to create and add users to the database. 

Scroll to the MySQL User section to create one. Please type your username and passwords in the appropriate fields to get it done. You could use the password generator to get a strong password.

Scroll down to the next section to add the newly created user to the database. Select the newly created database and user, then click the Add button to complete step four.

5. Run the Duplicator Package Installer 

Run the duplicator installer to complete the cloning.

Go to yourdomain.com/installer.php to run the duplicator package installer. Remember to replace yourdomain.com with your website URL, the one you uploaded the duplicator package to.

The installer will scan and double-check the hosting environment to ensure everything is correct. Then, accept the terms and conditions to proceed to the next stage.

Enter the details of the previously created database to link the new website to a database. 

The action will delete everything in the database to add the cloned WordPress content. So ensure you’re using only the newly created database for this process.

Click the Next button to continue.

In step three of four, the installer will automatically update your domain data, so you don't have to do anything here other than click Next to complete the cloning.

However, you can add a new admin account before clicking the Next button. It's also helpful if you're cloning a WordPress site you don't have the admin dashboard login.

Click Options to reveal a drop-down. Enter all the required information in the appropriate fields and click Next to complete the process.

Now login to the WordPress admin to finalize the installation. Next, check the Auto delete installer files after login box to let Duplicator automatically remove the installer files.

Leaving the file behind is a security risk, as someone can easily overwrite your site using it.

You may need to update your wp-config.php file if you see a blank WordPress site after the installation. For example, it could happen if you're migrating to a new WordPress install. 

Head to the wp-config.php file of the original server to see the table prefix it uses and apply the variable on the new wp-config.php file.

You can find the wp-config.php file in your root directory via cPanel.

So endeavor to download your wp-config.php and .htaccess files before uploading the Duplicator packages.

Wrapping It Up

That’s it.

Cloning a WordPress site shouldn't be as hard as it sounds. With the Duplicator plugin and the few steps outlined in this article, you should get it done in a few minutes.

Feel free to contact us if you run into issues, and we'll be glad to help.

Read More

About Nicholas Godwin

Nicholas Godwin is a technology and marketing researcher. He helps businesses tell profitable brand stories that their audiences love since 2012. He's been on the writing and research teams of Bloomberg Beta, Accenture, PwC, and Deloitte to HP, Shell, AT&T.