How to Clone a Website to a Subdomain or Staging Environment
Perfect for testing changes, developing new features, redesigning websites, or training staff.
What Is a Staging Site?
A staging site is a copy of your live website placed in a safe, private location such as:
- staging.yourdomain.com
- dev.yourdomain.com
- test.yourdomain.com
You can build or edit without affecting your public site.
⚠️ Think of staging as your “sandbox” — a place to break things without consequences.
Why You Should Use a Staging Website
- Test new plugins or themes safely
- Develop features before launch
- Train staff without risk
- Run updates without breaking live site
Even big companies like Facebook, Amazon and Google use staging systems.
Step 1: Create a Subdomain in Nairahost
- Login to cPanel
- Click Subdomains
- Enter a name like
staging - Select your domain
- Click Create
Your staging folder will now exist at:
/public_html/staging
Step 2: Copy Files Into Staging Folder
Option 1 – Manual Copy
- Open File Manager
- Copy all files from
public_html - Paste into
public_html/staging
Option 2 – Using WordPress Plugins
- WP Staging
- Duplicator
- All-In-One Migration
???? WP Staging creates a full clone inside your hosting automatically.
Step 3: Clone Database
- Open phpMyAdmin
- Select your live database
- Click Export → Download
- Create new database → Import SQL
Step 4: Update Configuration (WordPress)
Edit wp-config.php in your staging folder:
define('DB_NAME', 'staging_db');
define('DB_USER', 'staging_user');
define('DB_PASSWORD', 'yourpass');
Then change site URLs in phpMyAdmin:
UPDATE wp_options SET option_value='https://staging.yourdomain.com' WHERE option_name='siteurl';
UPDATE wp_options SET option_value='https://staging.yourdomain.com' WHERE option_name='home';
Step 5: Protect the Staging Site (Important)
You do NOT want Google to crawl or index your staging site.
Option 1 – Enable “Discourage search engines” in WP Settings
Option 2 – Add password protection via cPanel
- Go to Directory Privacy
- Select staging folder
- Enable password protection
Step 6: Working on Your Staging Site
- Install plugins safely
- Test new themes
- Debug code
- Make design changes
Step 7: Push Staging to Live
Once you're satisfied, copy updated files and database back to your main site. Plugins like WP Staging Pro and Duplicator Pro can automate this.