Backups
Restore a backup
Put a site back from a downloaded backup: import the database dump, copy the files back, and check the site, step by step and safely.
Applies to: Paid plans
The dashboard does not restore a backup for you yet. You restore it yourself from the downloaded zip, which holds everything needed. Safe updates are different: they roll back on their own. See Safe updates and rollback.
On the free plan there are no scheduled backups to download, so keep a backup of your own and restore from it the same way.
If you can, restore to a staging copy first, and only then to the live site.
Before you start
- Download the backup and unzip it. You get
database.sql.gzand afiles/folder. - You need access to the server (SFTP or SSH) and to the database, for example through your host's control panel or phpMyAdmin.
- Take a fresh backup of the site as it is now, in case you need to undo the restore.
Restore the files
- Connect to the server over SFTP or SSH.
- Copy the contents of
files/over the site's WordPress folder. To return to exactly the backed-up state, delete files that were added since; otherwise leave them. - Keep the current
wp-config.phpif the database name, user or password have changed since the backup.
Restore the database
- Unzip
database.sql.gzto getdatabase.sql. - Import it into the site's database, replacing the existing tables: in phpMyAdmin with Import, or over SSH with
wp db import database.sqlfrom the WordPress folder. - If the site's address has changed since the backup, replace it:
wp search-replace 'https://old.example' 'https://new.example'.
Check the site
Load the homepage and a few key pages, sign in to wp-admin, and in the dashboard click Sync on the site so its data catches up.