Maintenance

Website backup and restore: how to make sure your backup actually works

What should you back up on a website, how often, where should the copies be stored and how do you test a restore? A guide to the 3-2-1 rule and a recovery plan.

Updated

A backup is the most important safety net in maintenance. It saves the day when an update breaks the site, malware destroys files, an administrator deletes pages by mistake or the provider's server fails. Yet many businesses only find out in an emergency that there is no copy, that it is old or that it cannot be restored.

This guide covers what to back up, how often and where, and how to make sure a restore works.

What should you back up on a website?

A dynamic website such as WordPress consists of two parts that must be backed up together:

  • Files: the CMS files, the theme, plugins, the media library (images, PDFs) and configuration files such as wp-config.php and .htaccess.
  • Database: the content of pages and posts, settings, users, form submissions and an online shop's products and orders.

A database without the media files gives you a site without images. Files without the database give you an empty installation. It is also worth attaching a list of the installed versions (PHP, CMS) and the DNS settings to the backup, because you will need them if the site has to be restored to a completely new environment.

How often should you take a backup?

Backup frequency is driven by one question: how much data can the business afford to lose? This is called the RPO (recovery point objective). Another important measure is the RTO (recovery time objective), meaning how quickly the site must be back up and running.

Type of website Recommended frequency Reason
Brochure site that rarely changes Daily and before every update Few changes, a daily copy is enough
Active blog or news site Daily Frequent new content and comments
Online shop Database several times a day or continuously Every lost order is lost sales and customer data
Member or customer portal Database continuously Users create data all the time

In addition, always take a copy before updates, a PHP version change and larger content changes.

The 3-2-1 rule

The basic rule of backups is 3-2-1:

  • 3 copies of the data (the original and two backups)
  • 2 different types of storage or services
  • 1 copy in a different location from the website itself.

For a website, this means in practice, for example, the hosting provider's own daily copy plus an automatic copy to a separate cloud storage service whose credentials are different from the website's. That way an attacker who takes over the site cannot also delete the backups.

The most effective protection against ransomware is immutable or versioned storage, where copies cannot be deleted or overwritten before the retention period ends.

Retention period

The latest copy alone is not enough. An infection or an error can be on a site for a long time before anyone notices, and by then the newest copies are contaminated too. A good starting point is:

  • daily copies for 30 days
  • weekly copies for 3 months
  • monthly copies for a year.

Retention periods must also take data protection into account. If the database contains personal data, keeping backups is processing of personal data, and it must match what the privacy notice says.

Testing restores

The most common backup mistake is never having tried a restore. A copy can be incomplete, encrypted with a password nobody remembers or so large that the hosting provider's restore tool cannot handle it.

A restore test is done like this:

  1. Create a separate staging environment or a temporary subdomain with indexing blocked.
  2. Restore the files and the database there from the selected backup.
  3. Update the site address in the database if needed.
  4. Check that pages, images, forms and login work.
  5. Write down how long the restore took and what problems came up.
  6. Delete the test environment or protect it with a password.

The recorded restore time gives you a realistic RTO. If the restore took six hours but the business can only tolerate a one-hour outage, the solution needs improving.

A recovery plan for incidents

In an emergency there is no time to hunt for credentials. Record in one place:

  • where the backups are and which credentials give access to them
  • who can decide on a restore and who carries it out
  • the restore steps as written instructions
  • support numbers for the hosting provider and the domain service.

If the cause is a data breach, a restore alone is not enough. The vulnerability must be fixed and credentials changed, or the site will be broken into again. If personal data may have leaked, also assess whether the incident must be reported to the data protection authority (in Finland, the Data Protection Ombudsman). Under the GDPR, the report must be made within 72 hours of becoming aware of the breach if it poses a risk to people's rights.

Backup checklist

  • Are both the files and the database backed up?
  • Is at least one copy in a different location from the site, with different credentials?
  • Does the frequency match how much data you can afford to lose?
  • Is the retention period at least 30 days?
  • Has a restore been tested in the last three months?
  • Does everyone know who does the restore and where the instructions are?

Backups are part of broader website security. Compare hosting providers' backup features already when choosing a server.

Frequently asked questions

Is the hosting provider's own backup enough?

It is a good first layer, but rarely the only one you need. Check the contract for how often copies are taken, how long they are kept and whether restoring costs extra. If the website and its backups sit in the same environment with the same provider, the same incident can affect both. A separate copy in another location removes that risk.

How long should backups be kept?

At least 30 days is a good starting point. A malware infection can be on a site for weeks before it is noticed, so last night's copy alone may contain the same infection. Keep daily copies for 30 days and monthly copies for longer.

Do backups contain personal data?

Almost always. The database may contain form submissions, customer accounts and orders. Backups are therefore covered by data protection rules: they must be protected, you must know where they are stored and the retention period must match what the privacy notice says.

How often should restores be tested?

At least quarterly, and whenever the backup solution, the server or the structure of the site changes significantly. The test is done in a staging environment, not on the production site.

Sources

  1. National Cyber Security Centre Finland (Traficom)
  2. WordPress.org Documentation: WordPress Backups
  3. Office of the Data Protection Ombudsman (Finland)