Web hosting · Practical guide

Test a website backup before you need it

Restore a copy in a separate environment and check files, database and application behavior.

Archive placement: February 2025

A laptop and external storage drives on a desk

A restore test answers a simple question: can you rebuild a working website from the backup you actually have? Use an isolated location, restore both files and database, and test real features. Finding a missing database or an old plugin dependency is much easier during a test than during an outage.

1. Keep the test separate from production

Create a separate folder, database and application configuration. Protect the test site from public access. Use test credentials where possible, and disable outgoing mail, payment processing, webhooks and scheduled jobs before starting the restored application.

Do not point a test copy at the live database. A staging site using real production settings can change orders, send messages or run background work even if nobody visits it. Check the configuration before opening the application.

2. Prepare a staging site that cannot affect customers

Create a separate document root and a new empty database with a database user authorised for that database. Use a staging hostname or a local test environment. Protect it with authentication or a network restriction; a robots noindex tag alone does not protect private data.

Before starting the restored application, block outbound customer email, payment processing, webhooks and scheduled jobs at the staging environment or application configuration. Disable production API keys and replace them with test credentials. A restored database can still contain active integrations, even if you have not opened the homepage yet.

Write down the staging path, database name and hostname and compare them with production. If they are the same, stop. Do not use a live database as the destination for a practice import.

3. Upload and extract the files into staging

Work in a separate document root so a mistaken overwrite cannot replace the live site. Keep the saved backup on your computer as well.

  1. Create or confirm the staging domain in cPanel → Domains and write down its document root. Protect the test site with Directory Privacy where suitable.
  2. Open that folder in File Manager, choose Upload and send a copy of the website archive. Extract it into the staging folder.
  3. Inspect the extracted structure. The application index file should be in the staging document root, not accidentally nested inside another public_html folder.

Enable Show Hidden Files to check .htaccess. Keep staging email, payments, webhooks and scheduled jobs disabled before opening the restored application. A password-protected page does not stop background integrations from running.

4. Create a separate database and user

Use new database names for staging. Reusing the live database would turn a recovery test into a change to the production website.

  1. Open cPanel → Manage My Databases, or MySQL Databases on older interfaces. Create a database with a clearly different staging name.
  2. Create a new database user and a unique password, then add that user to the staging database with the permissions the application requires.
  3. Record the complete names, including any account prefix added by cPanel. Update only the staging application configuration in File Manager to use those names.

For WordPress this is the staging wp-config.php file. Confirm the database host with the account settings rather than guessing a remote hostname. Do not send the configuration file or database password in an ordinary support message.

5. Import the database through phpMyAdmin

The selected database determines where the import goes. Verify that name again immediately before uploading the SQL file.

  1. Open cPanel → phpMyAdmin and select the new staging database from the sidebar.
  2. Choose Import, select the matching SQL backup and start the import. Leave the browser open until it reports completion.
  3. Confirm the expected application tables appear. If the import reports errors, save the error text and resolve it before testing the site.

Do not repeat an uncertain import over populated tables without checking what completed. For a file above the upload limit or a failed large import, ask support for an appropriate restore process instead of splitting the SQL file at arbitrary lines.

6. Set staging addresses without damaging WordPress data

A restored WordPress database may still send visitors to the live domain. Use a staging or clone tool supplied with your installer when it can handle the address changes for you.

  1. If your cPanel WordPress management tool offers a documented staging/clone action, use it and verify that its destination is the isolated staging site.
  2. For a manual single-site restore, use phpMyAdmin to locate that installation’s options table. Its prefix may differ from wp_. Edit the plain siteurl and home values to the staging HTTPS address so you can sign in there.
  3. For stored content and plugin settings, use a WordPress-aware search-and-replace tool on staging, with a dry run where available. Keep the original restored database available before applying it.

Do not perform a global text replacement inside an SQL file: WordPress can store serialized settings that such a replacement breaks. Multisite and custom applications need their own documented migration process. Ask for help if you cannot identify the correct tables or URL-change method.

7. Run a short application test

Check the home page, an internal page, login, an uploaded image and a feature that reads from the database. Check application logs for errors. Test the PHP or runtime version as well as the restored files, because missing extensions can break an otherwise complete restore.

Write down what worked, what was missing and how long the restore took. Fix the backup process if the test exposed a gap. Remove the test environment securely when it is no longer needed, while retaining the backup copies required by your recovery plan.

8. Test recovery as a user, then record what was missing

  • Open several pages, older posts and uploaded media. Look for missing images or broken internal links.
  • Sign in with a test administrator, make a harmless staging edit and confirm it saves. Test forms only with customer notifications and external integrations disabled.
  • Compare a recent known record with the backup time. For a shop, check products and a sample order without creating a live payment.
  • Read application logs and check PHP version/extensions. A restored database alone will not supply a missing runtime dependency.

Record the backup used, time to restore, missing steps and whether the result met your recovery goal. After testing, remove or securely retain the staging copy according to your data needs. Keep the backup itself protected. If recovery required files from the running production site, add them to the backup process and repeat the test from the saved material alone.

Common questions

Can I restore only the files if the database was not damaged?

Sometimes, but file and database versions must be compatible. Plugins and application upgrades can change the database schema. Use a matched recovery set unless you have checked that a partial restore is safe.

Is a successful archive listing enough?

No. It proves the archive can be read, not that the database imports or the application starts. A meaningful restore test includes user actions and recent data checks.

Further reading

← Back to all guidesDiscuss your hosting setup ↗