Skip to content
GPLWP Guides

How to back up and restore a WordPress site

Backup & Migration Time About 30–60 minutes 6 steps Updated 17 Oct 2026

BACKUP & MIGRATION
The short answer

Back up both your WordPress files and database, store copies away from the server, then restore the files before importing the database. The manual route works, but a backup plugin is faster for scheduled backups, migrations, and one-click recovery.

The route
  1. 01Create a complete backup set
  2. 02Back up the site files
  3. 03Export the WordPress database
  4. 04Restore the files first
  5. 05Import the database and check the prefix
  6. 06Fix URLs and test everything

What you need

  • WordPress administrator access
  • SFTP, FTP or hosting File Manager access
  • phpMyAdmin or another database export tool
  • A safe off-site location for backup files

Create a complete backup set

A full WordPress backup has two separate parts: the files on your server and the database. Files contain WordPress, themes, plugins, uploads, wp-config.php and server rules; the database contains posts, pages, settings, users and other site data. You need both parts to restore a typical site.

Before a core, theme or plugin update, create a fresh backup. For a busy shop or membership site, pause changes if possible so the files and database represent the same point in time.

Back up the site files

Use SFTP, FTP or your host's File Manager to download the entire WordPress installation to your computer. Include wp-content, wp-config.php, the WordPress core files and any custom files such as .htaccess. Do not assume that downloading the WordPress folder also backs up the database; it normally does not.

If your host provides a full-account backup, keep that as an additional copy, but make sure you can identify the site's files inside it.

Export the WordPress database

Open phpMyAdmin from your hosting panel, select the database named in wp-config.php, choose the export option and save the SQL file. Check the database name, username and password in wp-config.php before selecting a database, especially if the account contains more than one site.

Store the SQL export with the matching file backup and label both with the date. Keep at least one copy outside the server, because a backup stored only on the same hosting account can disappear with the site.

Restore the files first

For a damaged site, preserve the current files and database before replacing anything. Then upload the backed-up WordPress files to the correct document root, replacing the damaged copy. WordPress recommends restoring the files first and importing the database afterwards.

If the site is moving to a new host, create the destination database and user first. Edit wp-config.php so the database name, username, password and host match the new server.

Import the database and check the prefix

In phpMyAdmin, select the destination database and import the matching SQL file. The table prefix in wp-config.php must match the restored table names. A mismatch can make WordPress show the installation screen, report missing tables or fail to load the site even when the import completed.

Do not overwrite a working database by mistake. If several databases appear in phpMyAdmin, compare their table names with the prefix configured in wp-config.php before importing.

Fix URLs and test everything

If the domain or installation path changed, update the site's URLs and replace old references throughout the database using a method that understands serialized WordPress data. Changing only the two main URL settings may load the site but still leave broken image links, menus or plugin settings. WordPress also advises reconfiguring permalinks after a move when rewrite rules are involved.

Log in, open a few posts, test images, forms, search, email, orders and scheduled tasks, then resave the permalink settings. For the fast route, IThemes BackupBuddy can schedule full-site backups, store them remotely, restore them and help migrate a site from one location to another. Still keep an independent host or off-site copy and test a restore before you need it.

The fast route

Let IThemes BackupBuddy do it

Scheduled full-site backups, one-click restores, and migration tools for site owners who want an all-in-one recovery workflow.

Get IThemes BackupBuddy

Sources

  1. developer.wordpress.org /advanced-administration/security/backup/?utm_source=openai
  2. wordpress.org /support/topic/error-database-16/?utm_source=openai
  3. developer.wordpress.org /advanced-administration/upgrade/migrating/?utm_source=opena…

Questions

Do I need to back up both WordPress files and the database?
Yes. The files and database contain different parts of a WordPress site. Files hold WordPress, themes, plugins, uploads and configuration files, while the database holds content, users and settings. A files-only backup cannot restore your posts and settings, and a database-only backup cannot restore your themes, plugins or media files.
Can I restore WordPress without a backup plugin?
Yes. You can download the site files with SFTP or a hosting File Manager, export the database with phpMyAdmin, then restore the files and import the SQL database manually. The drawback is that you must handle credentials, table prefixes, URLs and file permissions yourself. Manual backups are fine for occasional work, but scheduled recovery is easier with a suitable plugin or host service.
Why does WordPress show the installation screen after a restore?
WordPress commonly shows the installation screen when it cannot find the expected tables in the configured database. Check that <code>wp-config.php</code> points to the correct database and that its table-prefix setting matches the imported table names. This problem can occur even when the database import appears to have completed successfully.
What should I do when restoring to a new domain?
When the domain changes, restore the files and database first, then update the site's URLs and replace old domain references throughout the database with a method that handles serialized data. Also check media, menus, forms, redirects and plugin settings. If you only change the main URL fields, old links and embedded assets can remain broken.