Creating a Staging Site (Firstserv Guide)

A staging site is a copy of your live website where you can safely test updates, design changes, or new features without affecting your live site. It allows you to experiment with plugins, themes, or custom code before deploying changes to production.

This guide outlines how to manually create a staging site using cPanel. While the example uses WordPress, the same general process applies to most websites.


Step 1: Create a Subdomain

  1. Log in to cPanel
  2. Navigate to Domains → Domains
  3. Click Create a New Domain
  4. Enter your staging address (e.g. staging.yourdomain.com)
  5. Untick Share document root (so it uses a separate folder)
  6. Click Create

✅ cPanel will automatically create a directory (e.g. /staging.yourdomain.com)


Step 2: Copy Your Website Files

Option A: Using File Manager

  1. Open File Manager in cPanel
  2. Navigate to your live site directory (usually /public_html/)
  3. Select all files and folders
  4. Click Copy
  5. Choose your staging directory (/staging.yourdomain.com)

Option B: Using FTP

  1. Connect via FTP
  2. Download all files from /public_html/
  3. Upload them to /staging.yourdomain.com/

Step 3: Export Your Database

  1. In cPanel, open phpMyAdmin
  2. Select your live site’s database
  3. Click Export
  4. Choose:
    • Method: Quick
    • Format: SQL
  5. Click Go to download the file

Step 4: Create a New Database

  1. Go to MySQL Database Wizard in cPanel
  2. Create a new database (e.g. stagingdb)
  3. Create a database user with a strong password
  4. Assign the user to the database
  5. Grant All Privileges

✅ Make a note of:

  • Database name
  • Username
  • Password

Step 5: Import the Database

  1. Open phpMyAdmin
  2. Select your new staging database
  3. Click Import
  4. Upload the .sql file you exported earlier
  5. Click Go

Step 6: Update wp-config.php

  1. Open File Manager
  2. Locate:
    /staging.yourdomain.com/wp-config.php
    
  3. Update the database details:
 
 
 
 
 
 
PHP
 
 
define('DB_NAME', 'your_staging_database');
define('DB_USER', 'your_staging_user');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
 
 
  1. Save the file

Step 7: Update Site URLs

Option A: If You Can Log In

  1. Visit:
    https://staging.yourdomain.com/wp-admin
  2. Install the Better Search Replace plugin
  3. Replace:
    • yourdomain.comstaging.yourdomain.com
  4. Run the replacement across all tables

Option B: If You Cannot Log In

  1. Open phpMyAdmin
  2. Select the staging database
  3. Locate the table ending in _options
  4. Update:
    • siteurl
    • home

Set both values to your staging URL:

https://staging.yourdomain.com
  1. Save changes

After this, log in and run a full search/replace using a plugin.


Final Checks

  • Visit your staging site to confirm it loads correctly
  • Test functionality (forms, plugins, login, etc.)
  • Disable search engine indexing on staging (recommended)

Best Practices

  • Use staging for testing updates before applying them live
  • Keep staging separate from live data
  • Avoid running both sites simultaneously with the same integrations (e.g. payment gateways)

Summary

Creating a staging site involves:

  1. Creating a subdomain
  2. Copying website files
  3. Exporting and importing the database
  4. Updating configuration files
  5. Adjusting URLs for the new environment

A staging site gives you a safe environment to test changes and helps prevent issues affecting your live website.

If you need help setting up or managing a staging environment, the Firstserv support team is always available to assist.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install the Wordpress Litespeed cache plugin

  LiteSpeed Cache – What It Is and How It Helps If you’re running a WordPress website and...

How to disable the WordPress CRON job and set it up in cPanel

  Optimising WordPress Cron (wp-cron) – Firstserv WordPress does not...

Fixing WordPress mixed content issues

  Fixing Mixed Content Warnings When you visit a website using https://, your browser expects...

How to optimise your WordPress site

Optimising Your WordPress Website (Firstserv Guide) WordPress is a...

Configuring Redis Object Caching using Litespeed Cache

Object Caching and Redis (Firstserv Guide) What is Object Caching? Object caching is a...