ServerNeed — This Year's Best Offers For You

ServerNeed — More Than Hosting
Tutorials

How to Restore a Website From a Backup

Restore website files and databases from a backup, check the result, and avoid the common mistakes that overwrite newer data or bring a hack back with the restore.

5 min read 4 views
Several hard drives laid side by side
Table of Contents
  1. Before you restore
  2. Method 1: Your host's restore tool
  3. Method 2: cPanel partial restore
  4. Method 3: Manual restore
  5. Worked example: a plugin update broke the shop
  6. Restoring into a staging copy first
  7. Test after restoring
  8. If the restore followed a hack
  9. Frequently Asked Questions
  10. Related reading
  11. Sources

To restore a website from a backup: decide which backup to use and what to restore (files, database or both), protect any newer data you want to keep, restore the files and import the database, update configuration if anything changed, and test the site before announcing it is back. If the restore follows a hack, fix the cause first, or the site will be compromised again.

Before you restore

Choose the right backup

  • After a bad update or mistake: the most recent backup from before the change.
  • After a hack: a backup from before the compromise started, which may be older than you expect. See website malware: signs and what to do.

Decide what to restore

Situation Restore
Deleted or broken files, theme or plugin Files only
Broken or corrupted content, settings Database only
Whole site broken, or moving to a new server Files and database

Protect newer data

Restoring a database replaces everything in it. On an online store or membership site, export orders, customers or form entries created since the backup, or restore to a staging copy first and move only what you need.

Back up the current state

Even a broken site: take a copy before overwriting, in case you need something from it.

Method 1: Your host's restore tool

If your host provides a backup system in cPanel (for example JetBackup), you can usually restore files, databases or the whole account with a few clicks, choosing the date. This is the quickest option when available.

Method 2: cPanel partial restore

For backups made with cPanel's Backup page:

  1. Open Files → Backup.
  2. Under Restore a Home Directory Backup, upload the files archive.
  3. Under Restore a MySQL Database backup, upload the .sql.gz file.
  4. Under email, restore forwarders and filters if needed.

Full account backups are usually restored by the hosting provider; contact support.

Method 3: Manual restore

Files

  1. In File Manager, rename the current site folder or files you will replace (for example public_html contents into a broken-backup folder), or delete them if you have a copy.
  2. Upload the archive and Extract it to the right location.
  3. Check file permissions (files typically 644, folders 755).

Database

  1. In phpMyAdmin, select the database.
  2. Drop the existing tables, or create a fresh database, if you want a clean import.
  3. Choose Import, select the .sql or .sql.gz file, and run it.

For large databases, the import may exceed upload limits; ask support or use the command line (mysql dbname < backup.sql).

Configuration

If the database name, user or password differs from the backup's configuration, update it (for WordPress, in wp-config.php). If the domain changed, update URLs with a serialisation-safe tool; see how to migrate a WordPress site.

Worked example: a plugin update broke the shop

On Monday morning a plugin update leaves a WooCommerce shop's checkout returning errors. Ten orders came in on Sunday, after the last nightly backup.

The wrong approach: restore the whole site from Saturday night's backup. That would fix the checkout but delete Sunday's ten orders and their customer records.

The right approach:

  1. Restore only what broke: the plugin's folder, from the backup or by reinstalling the previous version. The database is untouched, so Sunday's orders remain.
  2. If the update also changed the database (some plugins migrate data), restore the database to a staging copy, compare, and move only the affected tables, or contact the plugin developer for a rollback procedure.
  3. Test checkout with a test order, then re-enable payments.

Restoring the smallest piece that fixes the problem keeps newer data intact.

Restoring into a staging copy first

When you are unsure what a backup contains or how it will behave, restore it to a subdomain such as staging.example.com (with a separate database) and check it there first. For WordPress, update the site URL in the staging database so links point to the staging address, and block search engines from indexing it. Once you are satisfied, repeat the restore on the live site, or copy across just the parts you need.

Test after restoring

  • Home page and key pages load correctly
  • Log in to the admin area
  • Forms send, checkout works in test mode
  • No errors in the error log
  • SSL works without warnings
  • Clear caches (plugin, server and CDN)

If the restore followed a hack

Before going live again:

  1. Update the CMS, plugins and themes.
  2. Change all passwords (hosting, FTP, database, admin) and security keys.
  3. Remove the vulnerability that was exploited.
  4. Scan the restored site.

See how to clean a hacked WordPress site for the WordPress process.

Frequently Asked Questions

Will restoring delete my emails?

Restoring files or databases does not touch mailboxes. A full account restore can, so check with your host first.

How long does a restore take?

Minutes for small sites, longer for large files or databases, plus time for testing.

My backup is missing the database. What now?

Check your host's backups for a database copy, and from now on make sure every backup includes both files and database.

Make good backups with how to back up your website in cPanel. Need help restoring on ServerNeed hosting? Contact support.

Backups and restores are part of website security basics.

Sources

Last updated 7 October 2026

View All Articles