Before applying updates (WordPress, themes, plugins), create a test copy — called "staging" — to verify functionality and avoid regressions on the production site. If your hosting provides WP Toolkit (in cPanel), cloning is quick and safe; otherwise use the manual method (copying the files + export/import of the database).

Prerequisites

Note: the term 'staging' refers to a temporary copy of the site used only for testing. It must remain private and isolated from the public.

Method A — Automatic cloning with WP Toolkit (recommended if available)

WP Toolkit (available in cPanel) offers a Clone button that copies the files, duplicates the database and automatically updates the copy's URLs. It’s the simplest and least error‑prone method.

WordPress installation and management in WP Toolkit on cPanel
Open WP Toolkit in cPanel and locate the WordPress installation to clone.
  1. Log in to cPanel, then open WP Toolkit. (See the WP Toolkit guide).
  2. In the list of installations, locate your site then click on Clone (or on the equivalent clone icon).
  3. Choose the destination: prefer a subdomain (e.g. staging.votredomaine.tld) to isolate the copy. WP Toolkit can automatically create the subdomain and database if you allow it.
  4. Let WP Toolkit create a new database/user (recommended option) or manually specify an empty database. Avoid the "overwrite" option unless you are certain of the target.
  5. Start the clone and wait for it to complete. Then test the cloned site: public pages, admin login, forms and media uploads.
WP Toolkit cloning form for a WordPress site — clone destination and database.
Cloning settings in WP Toolkit: destination, path and database options.

Tip (advanced): WP Toolkit also offers a command‑line interface (CLI) to automate large‑scale cloning. cPanel documentation: WP Toolkit (cPanel).

Method B — Manual cloning (copying files + database)

If WP Toolkit is not available, follow these steps. The actions are performed in cPanel (File Manager / phpMyAdmin) or via FTP/SFTP.

  1. Create the destination
    1. Create a subdomain (e.g. staging.votredomaine.tld staging.votredomaine.tld) via cPanel → Subdomains and note its document root. (Add a subdomain).
    Add a subdomain and choose its document root in cPanel
    Create a subdomain to isolate the cloned site.
  2. Copy the files
    1. Open the File Manager (or use FTP/SFTP). In the installation folder (usually public_htmlpublic_html), select all files and folders.
    2. Quick option: compress into a ZIP (button Compress), move or upload the ZIP to the subdomain folder, then extract it. This avoids copying files one by one via the interface.
    3. Or use the command Copy / FTP to duplicate the content into the subdomain folder.
    public_html folder and cPanel File Manager commands
    Copy the files from the production location to the subdomain folder (File Manager).
  3. Export the database (production)
    1. In cPanel, open phpMyAdmin, select the production database → tab Export → SQL format. For large volumes, choose compression (gzip) before downloading. (See the documentation: phpMyAdmin — Import/Export).
  4. Create a new database and a user
    1. In cPanel → MySQL Databases : create a new database, create a MySQL user and assign it to the database with all privileges.
    Create a MySQL database in cPanel
    Create the database and the MySQL user for the copy.
  5. Import the database into the target
    1. Open phpMyAdmin on the new database → tab Import → choose the exported SQL file → Execute. If the file exceeds the PHP upload limit, use the server-side upload area (Upload directory) or request the import via support.
    phpMyAdmin Import tab and SQL file selection — choose the SQL file and options
    Import the SQL dump into the clone's database via phpMyAdmin (Import → select file).
  6. Update wp-config.php wp-config.php
    1. In the clone folder, open wp-config.php wp-config.php (File Manager) and edit DB_NAMEDB_NAME, DB_USER DB_USER and DB_PASSWORD DB_PASSWORD to match the new database. Also check DB_HOST DB_HOST if it is different.
    Locate the WordPress wp-config.php file in cPanel — Edit file command
    Edit the database connection constants in wp-config.phpwp-config.php.
  7. Correct the URLs in the database
    1. In the table wp_options wp_options (table prefix varies), update siteurl siteurl home and home https://staging.votredomaine.tldto the clone URL (e.g. https://staging.votredomaine.tld).
    2. WARNING: WordPress sometimes stores serialized data (plugins, widgets). To safely replace URLs across the entire database, use WP-CLI (the wp search-replace command wp search-replace which handles serialization) or a specialized plugin — avoid a simple SQL search/replace if you are not sure.
    WordPress URL edit form in phpMyAdmin — Edit the WordPress Address value
    Modify the entries 'siteurl' siteurl and 'home' home in phpMyAdmin (beware of serialized data).
  8. Test
    1. Open the clone URL and test navigation, admin access (wp-admin), forms, image uploads and other critical features.
    2. Disable caching plugins and enable debugging locally if needed (WP_DEBUG) — log errors instead of displaying them.

Secure the staging copy

  • Restrict access Enable password protection on the clone directory (cPanel → Directory Privacy / Password Protect Directories) or restrict access by IP to prevent the site being discovered.
  • Discourage indexing In WordPress → Settings → Reading, check 'Discourage search engines from indexing this site'. This isn't a guarantee but it's a simple step.
  • Disable emails Prevent the clone from sending emails to real users. Simple solution: install a plugin that blocks outgoing emails on the staging environment or redirect SMTP to a test mailbox. Check the server's sending policy if necessary.
  • Disable scheduled tasks If cron jobs are active and could affect external systems (payments, newsletter sending), disable them temporarily on the clone.

Checklist before applying the update to production

  1. Perform all updates (core, themes, plugins) on the clone.
  2. Test critical functionality: payments, forms, search, admin login, media uploads.
  3. Check PHP / WP_DEBUG errors and access/error logs (cPanel → Metrics / Errors if available).
  4. Measure performance if the update could impact site speed.
  5. If everything is OK: take a full backup of production (JetBackup or cPanel backup) then schedule a maintenance window for the production update.

Common troubleshooting

  • Error "Error establishing a database connection" : check wp-config.php (database name, user, password, DB_HOST) and that the MySQL user has all privileges on the database. See: Error establishing a database connection.
  • Missing images : check that the files in the folder wp-content/uploads have been copied and that the media URLs have been correctly replaced in the database.
  • SQL import too large : if phpMyAdmin blocks the import due to PHP limits, use the server-side upload option, import via Terminal/SSH with the support team, or ask technical support for help.
  • Error 500 / white screen : temporarily enable WP_DEBUG in wp-config.php to see the error, check the PHP version (cPanel → MultiPHP Manager) and the memory limits.
  • License issues : some plugins or themes verify a license tied to the domain. Expect to need to reactivate/re-license some items on the clone or to test without a license.

Important limitations

  • The clone uses disk space and resources on the same hosting account: make sure you have sufficient capacity.
  • Tests on a clone do not isolate server-level changes (global PHP configuration, Apache/Nginx modules) if production shares the same server.
  • External licenses (SaaS services, API keys) may behave differently on a subdomain — adapt your tests accordingly.

Useful internal links

Need help? If you do not see the WP Toolkit icon in cPanel or if you prefer that we perform the cloning, open a ticket from your client area specifying the domain to clone and the desired URL for the copy (e.g. staging.votredomaine.tld). Also specify whether you would like us to make the copy private and to disable outgoing e‑mails.

Reference documentation

Documentation consulted on 16 October 2026. Tools may vary depending on your hosting.