Testing changes before publishing them to a live website helps prevent downtime, broken pages, and data loss. Plesk makes this process easier by allowing you to create a staging copy of your site where you can safely test code, content, and configuration changes.
This workflow is commonly used on environments where you have control over domains, files, and databases, such as setups running on Plesk hosting.
What a Staging Environment Is
A staging environment is a separate copy of your website used only for testing. It usually runs on a different domain or subdomain and mirrors the production site as closely as possible.
Typical uses include:
- Testing updates before applying them to the live site
- Reviewing content changes
- Verifying compatibility with plugins or custom code
Creating the Staging Environment
The staging site is usually created as a new domain or subdomain inside the same Plesk subscription.
For example, if your main site runs on example.com, you might create staging.example.com to host the staging version.
[Screenshot: Plesk domain or subdomain creation screen]
Once the domain or subdomain exists, you can start copying data from the production site.
Copying Website Files
Step 1: Open Website Copying
Log in to the Plesk control panel.
From the left sidebar, open Websites & Domains, locate the production site, and click Website Copying.
[Screenshot: Websites & Domains page with Website Copying icon]
Step 2: Select the destination
Under Copy Destination, choose Website in Plesk.
Select the staging domain or subdomain as the destination.
Decide how existing files on the destination should be handled, then click OK.
Plesk will copy all website files to the staging environment.
Copying Databases
If your website uses one or more databases, they must also be copied to the staging environment.
Step 1: Copy the database
In the Plesk sidebar, click Databases.
Locate the database used by the production site and click Copy.
[Screenshot: Database list with Copy option]
Step 2: Create a new database
Choose the local database server and select the option to create a new database with a custom name.
Enable Create a full copy, then click OK.
[Screenshot: Copy Database configuration screen]
After the copy completes, update the staging site’s configuration files so they connect to the new database instead of the live one.
Testing the Staging Site
Access the staging domain in your browser and verify that:
- Pages load correctly
- Forms and dynamic features work as expected
- Database-driven content is displayed properly
Testing is especially important for larger sites hosted on cloud servers where changes may affect multiple services.
Publishing the Staging Site
Once testing is complete, you can publish the staging version.
Step 1: Point the live site to staging files
In Websites & Domains, locate the production domain and open Hosting Settings.
Change the Document root to the directory used by the staging site and save the changes.
[Screenshot: Hosting Settings with Document root field]
Step 2: Verify database connections
If your site uses a database, confirm that the live site connects to the correct production database.
After publishing, review the live site carefully to ensure everything works as expected.
Staging workflows are particularly valuable on dedicated server environments where full control also means full responsibility for deployment accuracy.