Skip to main content
There can be many reasons you’d want to clone a website in cPanel. Before we cover the process, here is some basic terminology to help you understand it.

What is a cloned website?

Cloning a website means creating an exact replica or duplicate of a site hosted on your server. The cloned website will have identical files and database contents compared to the original. What differentiates the clone from the original is that the clone is hosted on a different domain or directory.

Why do you need to clone a website?

  • Deploying a testing or staging site. If your new website is for testing purposes, you might want to quickly clone it and test rather than build it fresh.
  • Setting up a new site with a basic configuration. Reuse the configuration you already spent time getting right, rather than reconfiguring from scratch.
  • Providing designers and developers a live-like working environment. Some functions can only be previewed in a live version, saving a lot of testing and error-fixing time.

Why clone using cPanel?

There are several tools to accomplish website cloning. The command line is one, but it is error-prone and time-consuming. cPanel allows you to automate steps where mistakes are likely and impactful, reducing cloning time and making the process seamless. We will cover two methods:
  1. WordPress Toolkit method — WordPress-specific, quick and easy.
  2. Manual cloning method — works for CMS & eCommerce sites, whether or not built on WordPress.

WordPress Toolkit method

  1. Open WordPress Toolkit.
  2. Locate the site to be copied.
  3. Expand to the detailed view.
  4. Click Clone.
  5. Select the subdomain and path to clone the website to. (If the path and subdomain don’t exist, WordPress Toolkit will create them.)
  6. Start cloning by clicking the button at the bottom of the page.
At the end of the process, along with the cloned site, you get a new database and database user, and the site is automatically configured to use the new database.

Manual cloning method

Any website built on WordPress, Joomla, or Drupal has two types of files that need to be copied over: the PHP code files, and static files stored in the site’s database (images, JavaScript, CSS).

1. Create a new directory for the new website

  1. Go to the Files section of the cPanel main menu.
  2. Create and name a new folder where all the files will be copied.

2. Copy the original site’s content to the new directory

  1. Select the site-to-be-cloned directory.
  2. Click Copy in the toolbar.
  3. Enter the name of the folder created in step 1.

3. Copy over the database

  1. Create a new database using the MySQL tools in cPanel: go to the Databases menu, open MySQL Databases, name your new database, and click Create Database.
  2. Export the original site’s database: go to the Databases menu, open phpMyAdmin, select the database from the left sidebar, select the Export tab, choose the quick export method, and click Go. An SQL file is downloaded to your local machine.
  3. Import into the new database: in phpMyAdmin, select the new database, choose the Import tab, click Choose File, select the SQL file you downloaded, and click Go.
You can access the database through the existing user or assign a new one. To assign a new user, go to the MySQL Databases page, scroll to Add New User, create a username and strong password, click Create User, then under Add User to Database select the new user and database, click Add, select “All Privileges”, and confirm.

4. Configure the new website’s database

For a WordPress site (other CMSs are similar):
  1. Go to File Manager and select the new site’s directory.
  2. Select the wp-config.php file and click Edit.
  3. In the MySQL settings section, update DB_NAME, DB_USER, and DB_PASSWORD with the new database name, user, and password.
  4. Save changes.
You can also update the new site’s URL from wp-config.php by updating the WP_HOME and WP_SITEURL values.

Conclusion

The Toolkit method is more convenient but specific to WordPress. For other sites, the manual method works, so knowing both is useful.

Frequently asked questions

What does it mean to clone a website? Cloning a website involves creating an exact duplicate, maintaining identical files and database content, and hosting it on a different domain or directory. Why would I need to clone a website? Cloning serves various purposes, such as deploying a testing or staging site quickly, replicating a site’s basic configuration, and providing designers and developers with a live-like working environment for accurate testing. Why should I choose cPanel for website cloning? cPanel offers a user-friendly and efficient platform for cloning. It automates critical steps, reducing errors and saving time compared to manual methods or command-line tools.