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
- Log in to cPanel
- Navigate to Domains → Domains
- Click Create a New Domain
- Enter your staging address (e.g.
staging.yourdomain.com) - Untick Share document root (so it uses a separate folder)
- Click Create
✅ cPanel will automatically create a directory (e.g. /staging.yourdomain.com)
Step 2: Copy Your Website Files
Option A: Using File Manager
- Open File Manager in cPanel
- Navigate to your live site directory (usually
/public_html/) - Select all files and folders
- Click Copy
- Choose your staging directory (
/staging.yourdomain.com)
Option B: Using FTP
- Connect via FTP
- Download all files from
/public_html/ - Upload them to
/staging.yourdomain.com/
Step 3: Export Your Database
- In cPanel, open phpMyAdmin
- Select your live site’s database
- Click Export
- Choose:
- Method: Quick
- Format: SQL
- Click Go to download the file
Step 4: Create a New Database
- Go to MySQL Database Wizard in cPanel
- Create a new database (e.g.
stagingdb) - Create a database user with a strong password
- Assign the user to the database
- Grant All Privileges
✅ Make a note of:
- Database name
- Username
- Password
Step 5: Import the Database
- Open phpMyAdmin
- Select your new staging database
- Click Import
- Upload the
.sqlfile you exported earlier - Click Go
Step 6: Update wp-config.php
- Open File Manager
- Locate:
/staging.yourdomain.com/wp-config.php - Update the database details:
- Save the file
Step 7: Update Site URLs
Option A: If You Can Log In
- Visit:
https://staging.yourdomain.com/wp-admin - Install the Better Search Replace plugin
- Replace:
yourdomain.com→staging.yourdomain.com
- Run the replacement across all tables
Option B: If You Cannot Log In
- Open phpMyAdmin
- Select the staging database
- Locate the table ending in
_options - Update:
siteurlhome
Set both values to your staging URL:
https://staging.yourdomain.com
- 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:
- Creating a subdomain
- Copying website files
- Exporting and importing the database
- Updating configuration files
- 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.
