How to Create a Basic Website Backup and Test a Restore

Silver and black hard disk drive

A backup you have never restored is a hope, not a backup. This tutorial shows how to create a complete backup of a WordPress website, store it somewhere safe, and then prove it works by restoring it to a test location. Set aside about an hour the first time.

What a complete backup contains

A WordPress site has two halves, and you need both.

  • The database. Posts, pages, settings, users, menus and most plugin data.
  • The files. The wp-content folder holds your uploads, themes and plugins. The wp-config.php file holds the database connection details and security keys.

WordPress core files can always be downloaded again, but a full-site backup is simpler to restore, so include them if space allows. For the thinking behind schedules and retention, see Website Backup Strategy: Define What You Need to Recover.

Step 1: Choose a backup method

  • Your host’s backup tool. Many hosting plans include daily backups and an on-demand backup button. Check how many days are kept and whether you can download a copy.
  • A backup plugin. A plugin can save files and database on a schedule and send them to remote storage. Evaluate it first using How to Evaluate a WordPress Plugin Before Installing It.
  • Manual backup. Export the database from the hosting control panel’s database tool and download the site files over SFTP or the file manager.

Using the host’s backups plus one independent copy that you control is a good baseline. If the hosting account itself is lost or locked, backups stored only inside it are lost with it.

Step 2: Create the backup

  1. Choose a quiet moment, ideally when nobody is editing content or placing orders.
  2. Run a full backup that includes both the database and the files.
  3. Wait until the tool reports that it has finished. Do not close the window part way through a manual download.
  4. Note the date, the time and the method you used.

Step 3: Store a copy away from the server

Download the backup, or let the plugin send it to remote storage such as a cloud drive that only you can access. A simple rule to aim for: at least two copies, in at least two different places, with one of them outside the hosting account.

Treat backups as sensitive. They contain user accounts, email addresses and the database password. Do not leave them in a publicly reachable folder on the website and do not share them by open link.

Step 4: Check the backup before you rely on it

  • The file size is plausible. A database export of a few kilobytes for a site with hundreds of posts is a warning sign.
  • The archive opens without errors on your computer.
  • The files include the uploads folder with recent images.
  • The database export contains the tables you expect, including posts and options.

Step 5: Test a restore somewhere safe

Never run your first restore test on the live website. Use a separate location.

  1. Create a staging site or an empty subdomain in your hosting account. What Is a Staging Website and When Should You Use One? explains the options.
  2. Restore the backup there, using the same tool that created it, or by uploading the files and importing the database into a new empty database.
  3. If you restored manually, update wp-config.php with the new database details and change the site address to the test address.
  4. Keep the test copy out of search engines: switch on the option that discourages indexing, or protect it with a password.
  5. If the site sends emails or takes orders, disable those functions on the copy so customers are not contacted by a test.

Step 6: Verify the restored site

  1. The homepage and several inner pages load with images.
  2. You can log in with your usual account.
  3. The newest post or page you created before the backup is present.
  4. Menus, forms and any shop pages appear as expected.
  5. Record how long the restore took. That is your realistic recovery time.

When you are satisfied, delete the test copy or keep it protected as your staging site.

Step 7: Make it routine

  • Schedule automatic backups. Daily is a sensible default for sites that change often, weekly for sites that rarely change.
  • Keep several older versions, not only the latest one. Problems are sometimes noticed days later.
  • Take an extra backup before updates, redesigns and migrations.
  • Repeat the restore test a few times a year and after changing host or backup tool.
  • Write the restore steps down, so someone else could follow them.

Common mistakes

  • Backing up files but not the database, or the other way round.
  • Keeping the only copy on the same server as the website.
  • Assuming the host keeps backups without checking the plan.
  • Discovering during an emergency that nobody knows how to restore.
  • Restoring a test copy that sends real emails to customers.

Next step

Add the backup check to your routine with the Monthly Website Maintenance Checklist. If you are preparing to change host, a tested backup is the first requirement.