Back to Community

How to Clone a WordPress Site to a Subdomain or Subfolder Without Conflicts

29 threads Sep 16, 2025 PluginDuplicator

Content

Cloning a WordPress site to a new location on the same server, like a subdomain or subfolder, is a common task for testing or development. However, it can be confusing to do this correctly without accidentally overwriting your live site. This guide will walk you through the safest methods to perform this clone using the free version of the Duplicator plugin.

Understanding the Core Challenge

The primary challenge when cloning a site on the same server is database management. By default, the Duplicator installer is designed to connect to and completely overwrite an empty database. If you point it to the same database your live site uses, it will erase all of that site's data. The free version of Duplicator does not support installing to a database with a different table prefix or merging data into an existing database.

Recommended Solution: Use a Separate Database

The most reliable and safest method is to create a brand new, empty database for your cloned site. Almost all hosting providers, including GoDaddy and OVH, allow you to create multiple databases through their control panel (e.g., cPanel).

  1. Create a New Subdomain or Subfolder: In your hosting control panel, create the new subdomain (e.g., staging.yoursite.com) or simply create a new folder in your public_html directory (e.g., public_html/staging).
  2. Create a New Database: In your hosting control panel, create a new, empty database and note the database name, username, and password.
  3. Build the Package: On your live site, use Duplicator to create a backup package (archive and installer.php).
  4. Upload Files: Upload both the archive file and installer.php to the root of your new subdomain or subfolder. For a subdomain, this is often a directory like public_html/staging. For a subfolder, it would be public_html/yourfolder.
  5. Run the Installer: Navigate to yournewsite.com/installer.php. During the installation process, when prompted for database connection details, enter the information for the new, empty database you created in Step 2. This ensures your live site's database remains untouched.

Alternative Workaround: Two-Part Install for Large Sites

If your site is very large (e.g., over 500MB) and you are encountering timeouts during the package creation, you may need to use the "Two-Part Install" method. This process involves creating a package that excludes the core WordPress files (wp-admin, wp-includes), which are then downloaded directly during the installation. Instructions for this method can be found in the Duplicator Quick Start Guide.

What to Do If You Only Have One Database

Some budget hosting plans restrict users to a single database. In this scenario, the free version of Duplicator cannot safely clone the site on the same server without risking data loss, as it requires an empty database. Your options are:

  • Upgrade Your Hosting Plan: Choose a plan that allows multiple databases.
  • Use a Different Staging Plugin: Some plugins, like WP STAGING, are specifically designed to create clones within a single database by using different table prefixes.
  • Clone to a Local Machine First: Use Duplicator to migrate the site to a local server on your computer (e.g., using XAMPP or a Virtual Machine), make your changes, and then migrate the updated site back to your live server, replacing the old one.

Important Final Steps

After a successful installation, it is crucial to manually remove the Duplicator package files from your server for security reasons. This includes the installer.php file, the installer-backup.php file (if it exists), and the archive file (usually a .zip or .daf file). Leaving these files on your server is a significant security risk.

By carefully managing your databases and file locations, you can effectively use Duplicator to create staging sites, test new designs, and develop safely without affecting your live website.

Related Support Threads Support