How to duplicate or clone WordPress site to another location

If you read my previous post about how to transfer WordPress site from one server to another, then you are somewhat familiar with the method of manual transfer, so to call it.
Now it is time to learn the easier and much faster method of doing this transfer of WordPress site, or its backup to be precise. For that purpose the XCloner plugin will going to help us. Big applause!!!

XCloner is a full backup and restore plugin for WordPress, it will backup and restore both files and database.

I will skip a bit from the beginning of using the plugin itself because I assume that you are familiar with installing a plugin within WordPress platform. So you go to plugin section, click Add New, search for xcloner, install, activate and you’re good to go! Login screen is set with default parameters and you can easily backup your website using Generate backup option with its default settings. So this would be the first step:

1. Create a backup of your website using XCloner plugin

Once this is done (depending on the size of your website it usually takes about 10-15 min) you will see the generated backup in the section Actions/View Backups from where you can download the .tar archive containing all the data from your website.

2. Locate and download the files TAR.php and XCloner.php

These two php files are necessary for the XCloner to perform its magic so you must download those as well. They are located in the plugin folder, so use your FTP client and navigate to:

3. Create new database on your new website location

No matter if you are transferring between servers or folders on the same server you need to create a new MySQL database. You can read more about it in this post.

4. Upload the files to your newly created directory on the server

It could be the root of a new hosting server if you are migrating or another folder on the same server or even another subfolder of a folder on a different server. In any case upload the backup .tar file and two php files from step 2 into the desired directory via FTP.


I repeat, don’t install WordPress on your new clone location because the backup .tar file contains all the files from your original WP site.

6. Run the XCloner script

Once the FTP transfer is done, and the database is created and ready to be populated, you may run the XCloner script by visiting the location of the XCloner.php file on your newly created clone location. For example, if you are installing in the root of another domain/host the URL should be something like this:
Or maybe you are moving to some testing location like this:
Whatever it is be sure to run it in your browser and you should see the following page.

7. Insert the database info and Start install

Usually the data on this page is filled correctly. You only need to insert the MySQL database name, username and password for newly created database from step 3 into the fields at the bottom and hit Start install button.
Please note that predefined server field filled with “localhost” sometimes requires the full name of DB server where your database resides, so this info you should find in your hosting account.

8. Click on database import link

Once the extraction is done you will see a link that says Please click here to continue with database import… Click it and the magic is done!
Please note that new database must be EMPTY!

That should be all and in most cases no problems should occur. Your clone site is up and running. Now you have two of them! Whatta ya know!

Known problems

Issue #1 – When you click on the Start install button on XCloner automatic Restore window you get Internal Server Error message screen.
Solution – Avoid backing up the .htaccess file and even wp-content folder. If you pass this error in the second run and with new backup file that does not contain .htaccess file you can re-upload the wp-content folder manually via FTP.

Issue #2 – When you click on the Start install button on XCloner automatic Restore window nothing happens, or brief change happens and you get back to the same screen but the database info disappeared. The database import is not executed.
Please feel free to post in the comments your experiences regarding this great plugin and issues you had so others can know about them and save time by avoiding them.

DISCLAIMER: I used the domain names and only for the sake of this tutorial and ease of understanding the process described here. I do not own this domains and mentioning them in this post is for identification purposes only. Use of this domain names does not imply endorsement.

By janoshke

Web developer and IT consultant. Freelancer with full respect for OpenCart and WordPress. Gamer, (ex)drummer and parent.


  1. Locate and download the files TAR.php and XCloner.php

    These two php files are necessary for the XCloner to perform its magic so you must download those as well. They are located in the plugin folder, so use your FTP client and navigate to:

    These files are not located under the stated folder. In the stated folder restore there is only one php file called:

    in the xcloner-backup-and-restore folder there is a file called XCloner.php however I’m not sure this is the correct one. And I cant find a file called TAR.php.

    Please help!

    1. Hi Lukas,

      Thank you for your comment.
      There has been some changes in file structure of the plugin itself after updates along the way, so the post you were reading here is outdated and describes the older version of XCloner (3.1.0).
      For further info please visit the official plugin website until I update the post with description on new functions. Here is a quick info from the plugin description that may help you for now:
      XCloner provide an easy to use restore script available in the Site Backup -> Restore Backups menu, the process is being described there as well.
      If the XCloner Restore option fails, you can manually restore your backup as follows:
      1) extract the backup archive files to your new location
      2) locate the xcloner-XXXXX folder inside your backup root folder, and look for the mysql backup in database-sql and import it through phpmyadmin
      3) update your wp-config.php file to reflect the new mysql details

    2. It has changed. Now when you select “Restore backup” on Xcloner menu on your WordPress panel, you are asked to download a TAR file to be extracted and then uploaded to the target site. When untarred, this file extracts the xcloner_restore.php file, a vendor.phar file and a folder vendor which contains more than 2 thousand files! I don’t know what they are used for, but this is the case… You’re supposed to upload all that to the target directory on the restoring site. I’m just trying this plugin to create a mirror site, so I can give no further info by the moment.

Leave a ReplyCancel reply

Exit mobile version