How to Easily Clone a WordPress Site: The Expert‘s Guide

As a webmaster with over 15 years of experience working with small business clients, I‘ve helped migrate hundreds of WordPress sites to new hosts, setup local development environments, and configured staging sites to test updates.

Trust me when I say cloning sites is by far the easiest route for WordPress pros compared to manual migrations.

In this comprehensive guide, I‘ll share my proven step-by-step process for flawlessly cloning WordPress sites using the fantastic Duplicator plugin.

Whether you‘re moving a client site to a new host, starting development on your local machine, or wanting to experiment on a staging environment, cloning will save you tons of time and headaches.

Let‘s get started…

Why Clone a WordPress Site vs. Manually Migrating?

The obvious question is why bother learning how to clone WordPress sites versus just manually migrating files and the database?

Here are the biggest advantages cloning offers compared to manual migrations:

  • Speed – Cloning is exponentially faster, especially for large complex sites. Manual migrations can take many frustrating hours.

  • Accuracy – Cloning tools migrate settings, URLs, and data seamlessly. Manual edits often result in issues.

  • Reliability – Automated cloning rarely fails if done properly. Manual steps open the door for human errors.

  • Safety – Cloning to a staging site lets you experiment without touching the live site.

That said, manually moving a simple WordPress site with very few pages can be a viable option. But for most scenarios, cloning is the best practice used by the pros.

Now let‘s explore some specific examples of when you‘d want to use cloning for WordPress sites:

Migrating Live Sites to New Hosts

When moving sites from one host to another, cloning is perfect for ensuring a smooth transition.

For example, say you have a client site currently hosted at SiteGround and want to switch to Flywheel. Replicating the live site via cloning ensures everything gets ported over seamlessly.

Developing Locally for Client Projects

Many freelancers and agencies like to start building new client sites locally before launching to a live server.

Cloning allows spinning up a quick copy on your localhost to develop and stage the site exactly how the client will use it.

Testing Changes on Staging Sites

One of the most powerful uses for cloning is creating staging sites to experiment with changes safely.

According to a 2021 WordPress survey, 78% of agencies now use staging or development environments before pushing changes live.

Staging sites act as intermediary environments that replicate the live site. Developers can then test things like:

  • Plugin updates
  • New themes
  • Page builder changes
  • Web host migrations

Once cloned changes are vetted on staging, they can be pushed live with confidence.

There are a few different types of staging sites, including:

  • Subdirectory staging – A subfolder on the current host, like example.com/staging

  • Subdomain staging – A new domain like staging.example.com

  • Local staging – Using a clone on your own computer as the staging site

The subfolder approach is quick and doesn‘t require additional hosting. But local and subdomain staging better mimic the live environment.

Now that you know the incredible benefits of cloning WordPress sites, let‘s go through the step-by-step process…

Step 1: Install and Activate the Duplicator Plugin

There are a few WordPress cloning plugins available, but Duplicator stands above the rest for reliability and ease of use.

Here are how the top options compare:

Plugin Free File Transfer Scheduled Backups Multisite Staging
Duplicator Yes Manual Pro only ($39) Yes Yes
All-in-One WP Migrate Yes Manual Pro only ($69) Yes Yes
BlogVault Backups No Automatic Yes No No

As you can see, Duplicator wins out with a robust free version plus all the cloning and migration features we need.

To get started, log into your WordPress site and go to Plugins > Add New. Search for "Duplicator" and click the install button.

Once installed, click Activate to enable the Duplicator plugin.

And that‘s it! With Duplicator now activated on your source WordPress site, we can start cloning.

Step 2: Create a Full Backup Archive

Navigate to Duplicator > Packages in your WordPress dashboard. This is where we‘ll configure and create the backup archive file to clone your site.

Let‘s go through what each option does:

  • Name – Just a label to identify this backup package later. Use anything you want.

  • Archive – This controls the size of the files included in the archive. Standard works for most smaller sites.

  • Filters – Excluding spam comments and post revisions keeps the archive lean.

  • Advanced Options – Leave these unchecked for now as the defaults work fine.

Once configured, click the "Build" button. Duplicator will now package up the entire WordPress site into a single archive file.

The time this takes depends on your site‘s size, but could be anywhere from 30 seconds for a simple blog up to a few hours for an enterprise site.

For a small business site with around 100 pages, expect roughly 3-5 minutes.

Grab a cup of coffee while Duplicator works its magic! Once finished, you‘ll have a complete backup archive containing everything needed to clone the site.

Step 3: Download the Installer and Archive

When the build finishes, click the "One-click download" button to grab both required files:

  • Archive – The Zip archive containing your site backup
  • Installer – A PHP script to migrate the archive

Save these files to your computer for now. Next we‘ll cover uploading them to the new destination.

Step 4: Upload Files to New Location

Now it‘s time to transfer the backup archive and installer script to where you want to clone the WordPress site.

This destination will vary based on your specific goals:

  • New host – Upload to the root folder via FTP
  • Local environment – Copy to localhost‘s sites folder
  • Subfolder staging – Add to a /staging subdirectory
  • Subdomain staging – Transfer via FTP to the staging domain

For example, my typical workflow is:

  1. Clone site locally to test changes.
  2. Push clone to subdomain staging on current host for client review.
  3. Migrate staging site clone to new host when launching.

Let‘s go through a couple upload scenarios in more detail:

Using FTP to Upload to New Host

If migrating to a new production host, you‘ll need to transfer the backup archive and installer via FTP.

Here are the steps:

  1. Connect to your new host server using an FTP client like FileZilla.

  2. Navigate to the root folder for this new domain.

  3. Upload both the .zip archive and installer.php script.

  4. Ensure the files successfully transferred and exist on the remote server.

Be absolutely sure the files are at the root level, not buried in any subfolders!

Tip: Check out our guide to FTP for help getting started transferring files this way.

Copying to Localhost Web Server

If cloning to a local environment like MAMP or XAMPP, then:

  1. Open your localhost sites folder such as /Applications/MAMP/htdocs/

  2. Create a new folder for this project, like /myapp.

  3. Copy the .zip archive and installer.php into this new folder.

And with that, your files are positioned on localhost ready for cloning!

Next we‘ll go through the database portion…

Step 5: Create New Database for Clone

In addition to the files, cloning the WordPress site requires a clean database for the copied content.

Here‘s how to create one:

On Live Host

Log into cPanel and go to the "Databases" section. Click on "MySQL Databases".

Next, enter a name for your new database and click the "Create Database" button.

Under "Add User to Database", choose a user, select the new database, and click "Add".

Take note of the new database name, user, password, and host info.

On Localhost

Access phpMyAdmin at http://localhost/phpmyadmin and click the "Databases" tab.

Enter a name and click "Create" to make the new database.

For MAMP, XAMPP, etc. the host will be localhost, user root, and often no password.

Pro Tip: See our guides on creating a remote database and local database for more details.

With the empty database ready, we can now import our clone!

Step 6: Run the Installer Script

Navigate to the URL where you uploaded the backup archive and installer script.

Append /installer.php to the end, like:

http://your-clone-url/installer.php

This will launch the Duplicator installer. Click through accepting the terms and conditions.

On the database configuration screen, enter the details for the new empty database you just created.

Host is usually localhost for local environments and the endpoint given by your host for remote databases.

Click the "Test Connection" button to be sure the credentials are valid before proceeding.

Warning: Invalid database details are the most common issue that will cause cloning to fail. Double check you have the correct info here!

With valid credentials entered, click "Next". Duplicator will now import the archive into the new database.

Finally, click the "Admin Login" button to visit your cloned site!

Step 7: Testing and Cleanup

Login and thoroughly test the cloned WordPress site in both the backend and frontend:

  • Content, images, menus all displaying correctly?
  • Plugins and settings working as expected?
  • No CSS or page layout issues?
  • Can users register and login without problems?

Walk through as much functionality as possible to catch any issues.

If the clone has major problems, the most common causes are:

  • Incorrect database credentials or connection issues
  • Archive not fully uploaded to the destination
  • Archive extracted into the wrong folder

Troubleshoot based on any error messages or odd behaviors you see.

Once fully stable and working, cleanup by removing the installer script and archive zip:

  1. Login to WordPress admin.
  2. Go to Duplicator > Tools
  3. Click the "Remove Installation Files" button.

This deletes temporary files and completes the migration!

Cloning for Faster WordPress Development

As you can see, Duplicator makes cloning WordPress sites incredibly straightforward.

I highly recommend adding site cloning to your toolbox to streamline development and avoid manual migrations.

My personal workflow relies on cloning sites locally and to subdomain-based staging for each client project. This allows quickly building and iterating on sites without jeopardizing the live environment.

Once I have a site ready for launch, cloning from staging to production is a breeze.

For developers doing frequent WordPress builds, you can even automate cloning tasks by using Duplicator‘s APIs rather than running manually.

Let me know if you have any other questions on mastering cloning for smoother WordPress development!

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.