---
title: "Restore a backup"
url: https://wpforeman.com/docs/restore-a-backup/
description: "Put the whole site, just the files, just the database, or a single file back the way it was. A safety backup runs first."
updated: 2026-10-13
---

# Restore a backup

You can restore any backup that’s still kept, which goes back at least 90 days (see [how long backups are kept](https://wpforeman.com/docs/how-long-backups-are-kept/)). Lockup always takes a safety backup of the site as it is right now before changing anything, so every restore can be undone.

Backups › Restore

## Restore the whole site, files or database

1. Open the site’s **Backups** page and pick the day and backup you want to go back to.
2. Click the **Restore** tab.
3. Choose what to restore (see below).
4. Type the site’s domain to confirm and click the restore button (for example **Restore whole site**).

| Option | What changes |
| --- | --- |
| **Whole site** | Files and database go back to exactly how they were. Files added since that backup are removed. |
| **Files only** | Themes, plugins, uploads and core files go back. Files added since that backup are removed. The database stays as it is now. |
| **Database only** | Posts, pages, settings, users, orders and form entries go back. Files stay as they are now. |

The Restore tab shows each stage as it runs: safety backup, unpacking, loading the database, restoring files, then swapping the database in. You’ll get an email when it finishes. Most small sites take a minute or two.

## Restore one file or folder

1. Pick the backup and open the **Content** tab.
2. Find the file or folder under **Site files** and click **Restore** next to it.
3. Type the domain to confirm.

Restoring one file. Nothing else on the site changes.

Restoring a file or folder only writes what’s in the backup. It never deletes anything.

## What a restore never touches

- **The WP Foreman plugin and its connection.** The site stays connected, even after a database restore.
- **`wp-config.php`**, unless you tick **Also restore wp-config.php**. Leave it off unless you changed database details or security keys since the backup.
- **Folders you excluded from backups**, and files the site couldn’t read at backup time. They’re left as they are.
- **Database tables that weren’t in the backup**, for example ones a plugin created since. They’re left in place.

## How the site is kept safe during a restore

- **Database first, into temporary copies.** Your tables are loaded into temporary copies before any file is touched. If loading fails, the copies are thrown away and nothing on the site has changed.
- **Then the files.** While files are being put back, a plugin or theme can briefly be half one version and half another. With WP Foreman plugin 0.8.1 or newer, the site skips other plugins and the theme for WP Foreman’s own restore requests during this step, so a half-restored plugin can’t stop the restore. Your visitors see the site as normal.
- **Then one swap.** When the files are in place, all the tables are swapped in at once.

If a restore does fail after files were put back, the message says so, and the safety backup taken at the start puts everything back the way it was.

## Copy to another site

The Restore tab also lets you copy a backup onto a different site, for staging or moving hosts. See [Clone or migrate a site](https://wpforeman.com/docs/clone-or-migrate/).

## Undo a restore

Find the **Pre-restore backup** in the list (taken just before the restore started) and restore that.

Restores need WP Foreman plugin 0.3.0 or newer on the site. Users who were logged in may need to log in again after a database restore.

---

WP Foreman: WordPress site management for agencies and freelancers. First site free, no card: https://app.wpforeman.com/signup
