Home / Blog / How to Clone a WordPress Site

How to Clone a WordPress Site

“How to clone a WordPress site” may seem like an article teaching you how to do something immoral or illegal. However, cloning a website isn’t always a bad thing. There are a couple of situations when a duplicate site is necessary. Here are the most frequent situations when a site clone is suitable:

1. Switching the Website’s Host

Complex websites with heavy traffic can’t be offline for too long. The site’s downtime affects your brand and income. Changing the website’s host is a complicated process that isn’t done many times in a website’s existence. To avoid any downtime, it’s a good idea to create a website duplicate that will stay online during the host switch.

2. Safe Environment for Testing

A website can be merely improved, but some modifications are risky to do on an online site. A cloned site is the best platform to test new themes, plugins, or features. You can do it on a local machine without any risk.

3. Work on a Client’s Site

A WordPress developer uses different local environments to create websites for clients. In this way, adjusting the site is risk-free. Once the client is happy with the developer’s work, the website is duplicated and published online.
Of course, there are other cases where a clone site is practical. Creating a clone isn’t a simple task, but with patience, even a less-experienced WordPress user can do it in just a few minutes.
You can duplicate a website either using PhpMyAdmin or a plugin. The latter is simpler and accessible to anyone. My recommendation is to use a plugin because some are free and tested by hundreds of thousands of users. Here, we will feature both methods.

The PhpMyAdmin Method


This is the most complicated method, but you don’t need to install any plugins. Follow the steps, and at the end, you will have a perfect replica of your site. The PhpMyAdmin console slightly differs for each host, but the differences are pretty insignificant. The screenshots below will help you find and click the right buttons.

1. Export your Current Database


To export your current database, head to the PhpMyAdmin console and find your website database. If you host a single entity, it will be simple; otherwise, select the correct database name. Next, hit the “Export” button and choose “Quick” as the export method and “SQL” as the format. Download the file and store on your hard-drive.

2. Replace the Instances of Old Site URLs

At this stage, open your SQL database (the one generated when you clicked “Export”) and replace the instances of old site URLs with the new one. It’s a find-and-replace work that may take you some time depending on the site’s complexity.

3. Edit the wp_config.php File


I assume that you have already setup WordPress on your new host or testing platform. If you need guidance, we have previously published a post about how to create a website with WordPress.
Find the wp_config.php file and open it with a text editor. Check for the strings related to database:
define(‘DB_NAME’, ‘database_name_here’);
define(‘DB_USER’, ‘username_here’);
define(‘DB_PASSWORD’, ‘password_here’);
Replace ‘database_name_here,’ ‘username_here,’ and ‘password_here’ with the new database name, username, and password.

4. Add the wp_content of the Old Site to the New Website


Download the wp_content folder files from the old site and upload them to the new one.
Hint: FileZilla is a reliable tool. The wp_content folder contains, amongst other files, the themes, plugins, and images of your website.

5. Discharge the New Database

Go to the PhpMyAdmin console of the new site (not the first console—pay attention to this piece of advice) and select the new database created. Check all the files and select “drop” from the drop-down menu.

6. Import the Customized Database

In the primary menu of the same PhpMyAdmin console is a section called “Import.” Click on it, check “Browse your computer,” and select the database you customized in the second step. Once you click on “Go,” this database will be imported. Now, your duplicate website should work!

Plugins to Clone a WordPress Site

By now, you should have created a new account on a web host or have set up a local machine to host your clone website.

1. WP Clone


WP Clone is probably the simplest alternative plugin to clone a WordPress website. Once you install it, Click “WP Clone” from the dashboard and tick “Create backup.” Depending on your website’s size, it may take a few minutes. Meanwhile, go to the WordPress dashboard on the new website and install WP Clone. Go back to the original site, and your backup should be done. Copy the URL of the backup and go to the duplicate website. Tick the “Restore from URL” and paste the URL. It is pretty simple to clone a WordPress site with WP Clone, isn’t it?
For security reasons, go to the original website and delete the backup created.

Try WP Clone for free

2. Duplicator


In some cases, the statistics of WordPress Repository or Addendio are enough to get a clear idea of a plugin. Duplicator is the most popular plugin for cloning WordPress sites. Over one million active installs and a rating of 4.9 out of 5 stars should convince anyone that it’s a great plugin. However, Duplicator is suitable for above the average users. Creating a clone is pretty complicated—simplicity isn’t its strongest point. It clones websites, creates backups copies, and let you move or migrate a site.

Try Duplicator for free

3.All-in-One WP Migration


This plugin works similarly to WP Clone. To duplicate or move your website, you need to export it and install it on the new host or local machine. It lets you import or export website files from multiple locations, including your hard-drive, Dropbox, Google Drive, OneDrive or Amazon S3. A distinctive note of this plugin is its high speed of exporting data. I tested it myself, and it’s much faster than WP Clone. Unfortunately, the maximum upload file size for the free account is 512 Mb.

Try Aii in one WP Migration for free

All the three plugins are free for the needs of average WordPress users. Of course, there are many premium plugins that clone a WordPress site, but they are pricey.
I hope that this post was useful for you. Anytime you want to clone a WordPress site, recheck this post and do your job. Please share it with your friends if you found it valuable.


 

Author: Daniel

Daniel Pintilie is part of our editorial team and he enjoys writing articles about WordPress, development, and Internet Marketing. In his spare time, Daniel plays video games and reads non-fictional books.

Add your opinion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>