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:
- Login to the cPanel account for LIVE
- Navigate to File Manager, opening it in public_html
- Use the "Select All" button, "Compress" it all into a new ZIP file
- Make sure the ZIP is stored in /home/username/ for security purposes
- Download your public_html ZIP file, THEN delete it via cPanel
- Return to the home page of cPanel, then open phpMyAdmin
- Note that you'll need to know the DB name
- Unsure? Check the site's wp-config.php file
- Single-click on the database (left-hand-side), then go to the Export tab at the top
- Leaving the settings on Quick, click the Go button and save the SQL file
- You now have a copy of your WordPress site's files AND database - great!
- This concludes the 1st part of the process. Onto restoring.
- Logout of the cPanel account for LIVE
Once your development subdomain/etc is ready, you can proceed with restoring and fine-tuning:
- Login to the cPanel account for DEV
- You'll need to create it, if not done already
- Navigate to File Manager, opening it into public_html
- Upload the ZIP file, then Extract it so that it rests under public_html
- Once completed (page refreshes slightly), DELETE the ZIP file immediately!
- Amend the wp-config.php file with new database details - you can do this later at Step 6 instead
- Return to the home page of cPanel, then click through to MySQL Databases (create a new DB & user per this KB)
- From the home page again, click through to phpMyAdmin, then open your new DEV database, then click on Import at the top
- Select the SQL file that you downloaded earlier, and click Go, then WAIT for the process to fully complete (or fail)
- 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
- Near the very top of the table, you should have "siteurl" and "home" entries - Edit those with the new domain
- PLEASE NOTE: If you're not comfortable with/near SQL, please raise a ticket with our Tech Support instead!
- With that done, you're ready to login to your DEV WP-Admin and install Better Search Replace to finalise changes
- Better Search Replace (WP): You'll need to run the following queries, after dry runs come back looking OK
- https://www.fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
- https://fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
- http://www.fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
- http://fibreopticcabling.com (OLD) > https://focdev.agency.net.au (NEW)
- //fibreopticcabling.com (OLD) > //focdev.agency.net.au (NEW)
- www.fibreopticcabling.com (OLD) > focdev.agency.net.au (NEW)
- fibreopticcabling.com (OLD) > focdev.agency.net.au (NEW)
- ORDER OF EXECUTION: Complete them as numbered here!
- PLEASE NOTE: Search & Replace is dangerous - BE CAREFUL!
- BACKUPS: Always verify a backup before any SQL works
- UNINSTALL: Please DELETE THE PLUGIN afterwards
- Better Search Replace (WP): You'll need to run the following queries, after dry runs come back looking OK
- 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.