Websites and applications

Duplicate or clone an application or website

Reviewed on 4 min read clonado aplicaciones

A clone lets you test changes or start another project from an existing website. For it to be independent you need to separate files, database and external connections: copying a folder is not enough if it keeps using the production data.

Prepare the destination

Create an empty domain, subdomain or directory and check its document root. Keep a backup of the original website. Work out the space you need for the files, the export and the duplicated database.

Protect the clone with authentication before opening it to the public. noindex helps keep it from being indexed, but it does not protect private data. In the clone, disable or replace real payments, emails, webhooks, cron and other integrations that could act on customers. Do not disable those services on the original website.

Duplicate a website manually

Clone the files

Copy the content to the destination root with the cPanel File Manager. Include the hidden files you need, such as .htaccess, and check whether there is storage outside that folder. Do not overwrite an existing installation.

Clone the database

Create a new database and its own user from cPanel. Assign that user only to the clone's database. Export the original database with phpMyAdmin and import the file into the new one; check that it finished without errors and that all the tables are there.

If the application receives constant writes, you need a consistent copy of files and data. Plan the timing or use the application's own backup mechanism. A static website may have no database; other applications use more than one.

Connect the app to the new database

Before running the clone, change its configuration: wp-config.php in WordPress or configuration.php in Joomla, for example. Check the name, user and password of the new database. Also review shared caches, upload directories and remote storage: different SQL credentials do not isolate those resources.

Change the URL to the new one

Update the address as the application requires. In WordPress, follow the guide to changing its URL; an indiscriminate SQL replacement can break serialised data. Adjust the clone's links, redirects and HTTPS without changing those of production.

Duplicate a website automatically

In Softaculous, find the installation and use Clone if it is available. Select the empty protocol, domain and directory for the destination and review the details of the new installation before confirming.

If the website does not appear, import it into the list. Importing it registers an existing installation; it does not move or duplicate it on its own.

To test changes that you later want to take to the original website, see the staging environment. Do not assume that an independent clone supports syncing later.

Check that the clone is independent

Open the front end and the admin area, make an identifiable edit and confirm that it does not appear in production. Check images, links, sessions and error logs. Submit forms or place orders only with test recipients and test payment gateways.

If you remove it, first identify its document root and database. Delete only those resources and their cron jobs; do not select the original installation or shared storage.

You may also find useful

Something wrong or out of date? Tell us and we will review it.