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): fibreopticcabling.com (Source)
New DEV site (example site): focdev.agency.net.au (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. https://www.fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
      2. https://fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
      3. http://www.fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
      4. http://fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
      5. //fibreopticcabling.com (OLD) > //focdev.agency.net.au (NEW)
      6. www.fibreopticcabling.com (OLD) > focdev.agency.net.au (NEW)
      7. fibreopticcabling.com (OLD) > focdev.agency.net.au (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.

  • 25 users found this helpful
Was this answer helpful?

Similar, and hopefully helpful

WP-CLI: Using the command line to update your WordPress install

If you're managing a range of sites, or even a single busy website, WP-CLI can save you valuable...