Creating a staging site manually

Creating a staging site

A staging site is a safe copy of your live site where you can test changes, updates, or new features without risking downtime or breaking your main site. It allows you to check plugin/theme updates, try out custom code, or redesign your site before deploying those changes live.

This guide walks you through setting up a manual staging site in cPanel. The process involves creating a subdomain, copying your site files, duplicating your database, and updating the site to use the new staging environment.

We’ll be staging a WordPress site in this guide, but the process is the same for any website — just update the configuration files to match your specific application.

Create a Subdomain

  1. Log in to cPanel.
  2. Go to Domains → Domains.
  3. Click Create A New Domain.
  4. Enter your staging URL (e.g. staging.yourdomain.com).
  5. Untick Share document root so the subdomain has its own folder.
  6. Confirm and create.
  7. cPanel will set up a folder, usually /staging.yourdomain.com

Copy Your Website Files

Option A: cPanel File Manager

  1. Open File Manager.
  2. Go to your live site folder (Usually /public_html/).
  3. Select all files → Copy → choose the staging folder (/staging.yourdomain.com).

Option B: FTP Client

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

Export the Database

  1. In cPanel, open phpMyAdmin.
  2. Select your live site’s database from the left menu.
  3. Click Export at the top → QuickSQLGo.

Create a New Database

  1. In cPanel, go to MySQL® Database Wizard.
  2. Enter a name for the staging database (e.g. stagingdb).
  3. Create a new database user (e.g. staginguser) with a strong password.
  4. Assign the user to the database with All Privileges.
  5. Note down the database name, username, and password — you’ll need them.

Import the Database

  1. In cPanel, open phpMyAdmin.
  2. Select the new staging database.
  3. Click Import, upload your .sql file, then click Go.

Update wp-config.php

  1. Open /staging.yourdomain.com/wp-config.php in File Manager.
  2. Update the database settings:
define('DB_NAME', 'user_stagingdb');
define('DB_USER', 'user_staginguser');
define('DB_PASSWORD', 'yourpassword');
define('DB_HOST', 'localhost');
  1. Save the file.

If you can log in:

  1. Go to staging.yourdomain.com/wp-admin.
  2. Install and run Better Search Replace.
  3. Replace all yourdomain.com with staging.yourdomain.com.

If you cannot log in:

  1. In phpMyAdmin, open the staging database and find the wp_options table.
  2. Once located, find and update the siteurl and home values to your staging URL.
  3. Then log in and install the Better Search Replace plugin and complete the above replacement.


How did we do?


Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–