Knowledgebase

How to Clone a Website to a Subdomain or Staging Environment Print

  • staging, no downtime, development, wordpress clone, clone website, testing site
  • 0

How to Clone a Website to a Subdomain or Staging Environment

Perfect for testing changes, developing new features, redesigning websites, or training staff.

Tags: staging, clone, test website, subdomain, wp staging, beginner friendly

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

  1. Login to cPanel
  2. Click Subdomains
  3. Enter a name like staging
  4. Select your domain
  5. Click Create

Your staging folder will now exist at:

/public_html/staging

Step 2: Copy Files Into Staging Folder

Option 1 – Manual Copy

  1. Open File Manager
  2. Copy all files from public_html
  3. 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

  1. Open phpMyAdmin
  2. Select your live database
  3. Click Export → Download
  4. 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

  1. Go to Directory Privacy
  2. Select staging folder
  3. 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.

Staging your website is the most professional and safest way to test changes before going live. Whether you're a beginner or developer, this workflow prevents mistakes and downtime. Every website that matters should have a staging copy, especially before redesigns or major updates.


Was this answer helpful?
« Back
Loading indicator for Nairahost web hosting services
WhatsApp chat support for Nairahost web hosting Nigeria Chat with us