Website cloning: How to duplicate a WordPress website (cP)

If you're not using a system like WordPress Toolkit for staging, you can easily clone sites within cPanel & WHM!

This guide assumes that you're using a cPanel+WHM (Linux) server), and have WHM access to jump between accounts.

Current LIVE site (example): (Source)
New DEV site (example site): (Target)

  • WARNING #1: Take a full SQL backup before performing ANY operations via phpMyAdmin - NO EXCEPTIONS!
  • WARNING #2: SQL modifications (via WP Plug-in & phpMyAdmin) can be dangerous. Uncomfortable? We can help.

Export the LIVE website so you can import it as a DEV copy:

  1. Login to the cPanel account for LIVE
  2. Navigate to File Manager, opening it in public_html
  3. Use the "Select All" button, "Compress" it all into a new ZIP file
    1. Make sure the ZIP is stored in /home/username/ for security purposes
    2. Download your public_html ZIP file, THEN delete it via cPanel
  4. Return to the home page of cPanel, then open phpMyAdmin
    1. Note that you'll need to know the DB name
    2. Unsure? Check the site's wp-config.php file
  5. Single-click on the database (left-hand-side), then go to the Export tab at the top
    1. Leaving the settings on Quick, click the Go button and save the SQL file
  6. You now have a copy of your WordPress site's files AND database - great!
    1. This concludes the 1st part of the process. Onto restoring.
  7. Logout of the cPanel account for LIVE

Once your development subdomain/etc is ready, you can proceed with restoring and fine-tuning:

  1. Login to the cPanel account for DEV
    1. You'll need to create it, if not done already
  2. Navigate to File Manager, opening it into public_html
  3. Upload the ZIP file, then Extract it so that it rests under public_html
    1. Once completed (page refreshes slightly), DELETE the ZIP file immediately!
  4. Amend the wp-config.php file with new database details - you can do this later at Step 6 instead
  5. Return to the home page of cPanel, then click through to MySQL Databases (create a new DB & user per this KB)
  6. From the home page again, click through to phpMyAdmin, then open your new DEV database, then click on Import at the top
    1. Select the SQL file that you downloaded earlier, and click Go, then WAIT for the process to fully complete (or fail)
  7. Now it's time to ensure that WordPress can load up on your new/dev sub/domain - open the wp_options table in the DB
    1. Near the very top of the table, you should have "siteurl" and "home" entries - Edit those with the new domain
    2. PLEASE NOTE: If you're not comfortable with/near SQL, please raise a ticket with our Tech Support instead!
  8. With that done, you're ready to login to your DEV WP-Admin and install Better Search Replace to finalise changes
    1. Better Search Replace (WP): You'll need to run the following queries, after dry runs come back looking OK
      1. (OLD) > (NEW)
      2. (OLD) > (NEW)
      3. (OLD) > (NEW)
      4. (OLD) > (NEW)
      5. // (OLD) > // (NEW)
      6. (OLD) > (NEW)
      7. (OLD) > (NEW)
      8. ORDER OF EXECUTION: Complete them as numbered here!
    2. PLEASE NOTE: Search & Replace is dangerous - BE CAREFUL!
    3. BACKUPS: Always verify a backup before any SQL works
    4. UNINSTALL: Please DELETE THE PLUGIN afterwards
  9. You should now be able to browse your LIVE and DEV websites separately, and work on your new development site!

Questions? That's what we're here for!

Let our Tech Support team know so they can give you a hand.

  • 1 users found this helpful
Was this answer helpful?

Similar, and hopefully helpful

IPv4/v6: Setting the PTR (rDNS) records for your addresses

To reduce abusive FCrDNS requests, please ticket our Technical Support team to set your PTR...

Resolvers / DNS: Choosing the best set for your servers

While there are many options available, we recommend Cloudflare and Google DNS in that order....

LiteSpeed Cache: Managing your sites via the WHM Plugin

It's easy to keep tabs on your different websites & accounts. LiteSpeed helps you keep...

VPS: Setting up LiteSpeed Cache (LSCache) for more speed!

Managed VPS customers enjoy this by default, though we're happy to share the LSCache love with...

Packages & LVE: Designing hosting plans for your clients

Are you puzzled with how to cut through the numbers and design effective hosting plans? Let's...