This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

🔊 Web Growth Summit is here! Learn from industry experts on July 17-18, 2024. REGISTER NOW→

How to Perform Website Cloning (5 Easiest Methods)

Updated on July 25, 2024

12 Min Read

Need to revamp your site or tweak functionalities without disrupting your live website?

Website cloning lets you create a replica to test changes and updates safely, avoiding risks like downtime and lost rankings. It also provides a starting point for new designs or templates, which you can customize to make your own.

For instance, maybe you like a particular hero image, navigation bar, or contact form design from another site—cloning can help you replicate and adapt those elements to fit your own design.

However, be cautious: cloning someone else’s site without permission can violate intellectual property rights and copyright laws.

In this article, we’ll cover methods for effectively cloning a WordPress site and discuss how to clone other websites as well.

Let’s get started…

When and Why Do You Need to Copy a Website?

You’ll need to copy a website in different situations to ensure any changes are made and tested on the staging environment before they are pushed live.

This is particularly helpful for web agencies that run several websites across multiple WordPress hosting providers. Whenever an issue arises, they can create a copy of the client’s website, fix it, and push it live again.

Here are a few scenarios where you might need to clone a website.

1. Compatibility Testing

Compatibility testing involves checking whether the website components are working as expected and whether the entire code base can run on various hardware and/or software infrastructures.

Testing changes on a staging/cloned website instead of a live website is always recommended, mainly because untested themes and plugins could conflict with the existing installation and bring down the entire website.

Similarly, any custom changes in the code need to be tested at a staging/cloned site before they can be pushed to the live site.

2. Moving to a New Server

Migrating a live website to a new server is always risky. Doing so without cloning the site can result in the loss of everything.

If you want to transfer a website to PHP hosting or to a different hosting provider, you should create a clone by backing up website files and databases and importing the whole package to the new web host. If things go wrong, you always have an operational clone ready to take live.

3. Back up Your Website

Cloning is also used to back up a website (including web files and database) and keep it at an offsite location for disaster recovery. In the case of WordPress, many people use different WordPress backup plugins.

I will also cover the process of copying a website that can be used to create a backup of your website.

4. Clone for a Similar Project

If you are a web agency that builds websites for clients, you may want to create a blueprint and copy it to another location to speed up the development process. Most of the time, these setups include theme and plugin configurations, code-level customizations, etc.

5. Take a Website Live

It’s common for developers to build websites on their preferred local environment and then clone the website to a web hosting server to ensure things do not break during the transition. This setup also requires a complete backup of website files and databases.

Before moving on to clone the website, you need to align several things. This ensures that your cloning process isn’t interrupted by negligence.

Ready to Clone Your WordPress Website in 5 Steps?

Cloning a WordPress website on Cloudways is a simple process, and it can be done quickly and easily in just 5 steps.

What Are the Prerequisites for Cloning a Website?

You’ll need the right tools and software to ensure the process runs without any hassle. Whichever process you choose. Some measures that you absolutely must have:

1. Access to Staging and Production Environments

Cloning the website to make the necessary changes has two parts: staging environment and production environment.

The staging environment is the cloned version where you make all the changes and test new features or design changes. The aim of the staging environment is to help you make the changes and see how a live website will look without disrupting the site that’s already up and running. Cloudways offers a free 1-click staging environment for all your applications and on all plans.

You’ll also need access to the production environment to track the progress of the changes that you make on a cloned website. The production environment is the audience-facing side of the website, and any changes made here are directly pushed live.

Access to production environments is necessary to tally the changes made in staging and, once live, to see that everything works as it did in the staging environment.

2. Creating a Website Backup

This is an absolute necessity. Usually, there’s nothing to worry about when cloning websites. But in case things go wrong, you should have the backups ready.

Website files are precious, and the data they carry is important. Cloning or making any changes to the website carries a slight risk of problems.

With Cloudways, you can configure server-level or application-level backups, making it easy to restore websites or applications to previous versions in cases of critical errors.

There are also several plugins and tools that you can use to create backups. Some examples include All-in-One WP Migration, UpdraftPlus, BackWPup, Duplicator, etc.

Once these precautions are in place, it’s time to move on to clone your website on a staging environment where you’ll make the necessary changes. Here’s how you do it via different methods.

How to Clone a Website: 5 Easiest Methods

As discussed above, I will use a WordPress website as an example throughout this guide. There are multiple methods to clone a WordPress website, but in this guide, I will cover the 5 easiest ones:

  • Method 1: Clone a Website Using Your Hosting Provider
  • Method 2: Clone a Website Manually
  • Method 3: Clone a Website Using a WordPress Plugin
  • Method 4: Clone a Website Using HTML
  • Method 5: Clone a Website Using Google Chrome Extension

Method 1: Clone a Website Using Your Hosting Provider

Cloudways specializes in WordPress hosting, allowing you to clone your website on the same and/or another server on its Platform. This saves a lot of complexities and reduces the steps of the process. Here’s how you can clone the website using Cloudways:

1. Simply select the application you wish to clone. To do that, click on View all Applications button.

select your application in Cloudways dashboard

2. Next to the application you want to clone, click on the three-dot menu. From the options that appear, select “Clone App/Create Staging.”

click on the 3 dost hamburger and then select clone app create staging

3. A popup will appear asking to select a server to clone the application. Click the dropdown, select the server on which you want to create a copy of the website, and click Continue.

Next to the application you want to clone, click on the three-dot menu. From the options that appear, select "Clone App/Create Staging."

The Cloudways Platform takes a few minutes to copy a website.

cloning application in process

Note that “Clone App” and “Create as Staging” are different in nature.

Clone App only clones a website while in the process of creating a staging site, both the live and staged applications are synced so that you can perform Push/Pull actions on both the replica and live versions.

5. Once done, you’ll see a cloned version of your application. And the credentials shown under the Admin Panel heading will be your access to the back panel of your cloned site.

cloned application and its credentials

The other way to clone a website is via WordPress plugins. Let’s see how that’s done.

Method 2: Clone a Website Manually

The manual process involves compressing all WordPress files and folders, exporting the old database, and importing the WordPress files and database to the new location.

Here are the steps to copy a website to a new location or the hosting provider.

Step#1: Compress WordPress Files

Step#2: Upload the Compressed File

Step#3: Migrate the Database

Step#4: Update the wp-config.php

1. Compress WordPress Files

First of all, navigate to the public_html directory of your WordPress installation, select all files, and compress them into a single archive.

compress

You now have a zip file in the public_html folder, and the URL will be example.com/FILE_NAME.zip.

Now, you have two options – either download the zip file and upload it to the new location via an FTP client like FileZilla or upload the zip file to the new location directly via SSH [faster than the FTP upload].

2. Upload The Compressed File

In my example, I will use SSH because of the speed advantage. I logged into the new hosting location via SSH and browsed to the location/folder where I wanted a copy of my WordPress website. Ensure the folder is empty (if not, use the following command to remove everything).

rm -rf *

Important: The deletion process is irreversible. So before executing a command, move all important files and folders to a safe location.

Now, use the following command to download the generated zip file.

wget URL_OF_ZIP_FILE

Don’t forget to replace the URL_OF_ZIP_FILE with the actual URL of the zip file. Next, use the following command to unzip it.

unzip FILE_NAME.zip

All folders and files will be extracted in the target folder.

3. Database Migration

After copying web files, the next step involves exporting the database from the current location and importing it to the new location.

Login to your database manager (phpMyAdmin is a popular choice). Select your database and navigate to Export. Download the exported .sql file.

Log in to the new database manager, create a database, and navigate to Import. If you already have a database, simply import the downloaded .sql file.

Click Choose File and upload the previously downloaded .sql file.

4. Update the wp-config.php

Since the website is already up and running, the wp-config.php file needs to be updated to connect the WordPress installation on the new location with the new database.

Get to the public_html folder, open the wp-config.php file, and enter the new database credentials.

If you still see old URLs anywhere on the website, replace them using the Better Search Replace plugin.

Better Search Replace wordpress plugin

Following one of the above methods, you can clone a website from one location to another. Generally, three steps are involved:

  1. Move the web files
  2. Export & Import Database
  3. Update the configuration file

Method 3: Clone a Website Using a WordPress Plugin

Like every other aspect of website management, WordPress has a lot of plugins that can be used to clone a WordPress website.

One is All-in-One WP Migration, a simple and easy way to use a backup and migration plugin for cloning a website. It allows you to export and import your existing WordPress website at a new location.

1. In your current WordPress installation, go to PluginsAdd New, search for All-in-One WP Migration, and Install and Activate the plugin.

all in one download and activate

2. From the left pane, navigate to All-in-One WP Migration → Export Click the Export to and select File.

export all in one

3. Wait a few seconds, and a popup will appear asking you to download the backup.

download

4. Download the file to your computer; the format will be .wpress. Keep it safe, as you will need it in the next steps.

5. Install a fresh WordPress on the new location, log in, and install the All-in-One WP Migration plugin. From the left pane, navigate to All-in-One WP Migration → Import, click the Import from, and select File.

import all in one

6. Browse the previously downloaded .wpress file.

Note: There is a chance that you might see the warning “Your file exceeds the maximum upload size for this site”. To deal with the issue, please refer to How to Increase Media File Maximum Upload Size in WordPress.

7. The process takes a while as it involves uploading and extracting the .wpress file. Once done, you will get a popup with a warning. Click Proceed.

caution error

8. On the next popup, click Save permalinks structure.

success message

9. You will be taken to the WordPress login page. Log in with the admin credentials of your old WordPress installation (because the original database has been replaced with the old WordPress website’s database). Click Save Changes on the Permalinks tab, and you are done!

Method 4: Clone a Website Using HTML

Step 1. Choose what you want to clone

Before you start the cloning process, it’s important to decide what you want to duplicate. For this example, I’ll be cloning the Cloudways About Us page for educational purposes.

cloudways about us page

Step 2. View the page source

The first step to cloning a page is finding the code that makes up its structure. Using Chrome, right-click on the page and select “Inspect.”

When you click “Inspect,” a panel will appear showing the code that comprises the page. Hovering over an element highlights its corresponding code, which is useful for understanding specific functions.

clone website using html in google chrome

To view the entire page’s code, right-click again and select “View Page Source,” or use Ctrl + U on Windows or Command + Option + U on Mac.

View Page Source

Step 3. Save the content

With access to the source code, you can now save the HTML. Right-click and save the file, ensuring it is saved as a .html file type.

save page source code

Step 4. Save essential assets and update paths

Often, CSS and other assets are linked externally. This can include logos, photos, and other elements. If you’re cloning a page you do not own, avoid copying image assets as they are likely copyrighted.

To find style sheets or other linked assets, look for <link> or <style> tags for CSS and <script> tags for JavaScript files. Save these files in the same directory as your HTML file.

Step 5. Save and view

Save your HTML file and open it in a web browser. You should now see a cloned version of the Cloudways About Us page.

Method 5: Clone a Website Using Google Chrome Extension

To download the source code of a website, you can use a Chrome extension called Save All Resources. Here’s how to get started:

1. Install the Extension: Add the Save All Resources extension from the Chrome Web Store.

save all resources chrome extention

2. Open the Website: Navigate to the website you want to duplicate. In this example, I’d again want to clone Cloudways About Us page.

3. Inspect the Page: Right-click on the page and select “Inspect” to open the developer tools.

4. Access Resource Saver: Click on the “More options” (>>), then find and select “Resource Saver.”

5. Save the Resources: In the Resource Saver panel, tick the necessary boxes and select “Save All Resources.”

cloning website using chrome extention

6. Download and Extract: The resources will be downloaded to your computer. Locate the downloaded file, extract it, and open the folder.

7. Verify the HTML: Inside the folder, find the HTML file and open it in your browser to ensure it works correctly.

Now that you’ve completed the cloning process, regardless of the method used, you might encounter some issues that need addressing. Let’s discuss a few common problems and their solutions.

Troubleshooting Common Site Issues After Cloning

Cloning a website is usually done to resolve an issue on an existing website. But, doing it directly in the production environment risks rupturing the site. It’s always best to test in the staging environment.

Here are some common issues to address after cloning:

1. Broken Links

Broken links are a bad omen for any website. These are links that display errors when clicked. Google treats broken links as a negative sign and can take down your rankings.

This is a common issue with big websites with many pages. When satisfied with the results, you can check and fix the broken links on the staging environment and push the site live.

Some plugins you can use to fix broken links are Broken Link Checker, Link Checker Professional, and Link Whisper.

2. Checking Plugins

WordPress runs on plugins. That’s truly a blessing because there’s a plugin ready as a solution for any functionality you can think of. But, testing some sensitive plugins or installing new ones directly in the production environment can be a risk.

Especially if you have a high-functioning site with thousands of visitors and customers visiting regularly, not all plugins are always compatible with WordPress themes or customizations. So checking your plugins in the safe zone is always better before taking them live.

3. Performance Optimization

Improving the website’s performance is essential to offer a seamless experience to visitors. It can include anything from design modifications to trimming content for a better experience.

Performance optimization can also mean overhauling your website and changing the theme. This part can require many changes, and it’s always best to execute it in a staging environment first and then push the changes live.

Once the changes are made and functionality is thoroughly checked, you can take things live. There are very slim chances that what runs well in the staging environment will create mishaps in the production environment. Rarely happens.

Yet, it’s also best to thoroughly check the site after it goes live. And if you are a Cloudways user, you should have it backed up from the first moment.

Summary

Cloning a website offers several uses and benefits. We’ve covered common methods, which are generally straightforward. However, if you lack at least moderate technical knowledge, it’s best to avoid the manual method.

Cloudways’ intuitive dashboard makes creating a clone of your website super simple, as we demonstrated earlier, with just a few clicks. This is the safest approach since everything is backed up. Alternatively, you can use the plugin method, which is also very easy.

That’s it from my side. I hope your cloning process goes smoothly!

Share your opinion in the comment section. COMMENT NOW

Share This Article

Mansoor Ahmed Khan

Been in content marketing since 2014, and I still get a kick out of creating stories that resonate with the target audience and drive results. At Cloudways by DigitalOcean (a leading cloud hosting company, btw!), I lead a dream team of content creators. Together, we brainstorm, write, and churn out awesome content across all the channels: blogs, social media, emails, you name it! You can reach out to me at [email protected].

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Get More Leads

10X Your Growth

Join the FREE Lead Magnet 101 MasterClass

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour

CYBER WEEK SAVINGS

  • 0

    Days

  • 0

    Hours

  • 0

    Mints

  • 0

    Sec

GET OFFER

For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now