Colonel Serveur

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, contenu, and configuration changes.

This workflow is commonly used on environments where you have control over domains, fichiers, et bases de données, such as setups running on Hébergement Plesk.

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.

Par exemple, if your main site runs on example.com, you might create staging.example.com to host the staging version.

[Capture d'écran: Plesk domain or subdomain creation screen]

Once the domain or subdomain exists, you can start copying data from the production site.

Copying Website Files

Étape 1: Open Website Copying

Connectez-vous au panneau de configuration Plesk.

Depuis la barre latérale gauche, ouvrir Sites Web & Domaines, locate the production site, et cliquez Website Copying.

[Capture d'écran: Sites Web & Domains page with Website Copying icon]

Étape 2: Select the destination

Sous 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, puis cliquez D'ACCORD.

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.

Étape 1: Copy the database

Dans la barre latérale de Plesk, cliquez Bases de données.

Locate the database used by the production site and click Copy.

[Capture d'écran: Database list with Copy option]

Étape 2: Create a new database

Choose the local database server and select the option to create a new database with a custom name.

Activer Create a full copy, puis cliquez D'ACCORD.

[Capture d'écran: 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 serveurs cloud where changes may affect multiple services.

Publishing the Staging Site

Once testing is complete, you can publish the staging version.

Étape 1: Point the live site to staging files

Dans Sites Web & Domaines, locate the production domain and open Paramètres d'hébergement.

Change the Document root to the directory used by the staging site and save the changes.

[Capture d'écran: Hosting Settings with Document root field]

Étape 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 serveur dédié environments where full control also means full responsibility for deployment accuracy.

Cet article a-t-il été utile?