גיבוי אתר וורדפרס: איך מגבים ואיך בודקים שהגיבוי עובד
WordPress troubleshooting

WordPress Backup: How to Back Up and Check That It Works

A complete WordPress backup has two parts that must be saved together: the site files and the database. If you have only one of them, you do not have a backup, you have half a site. The files hold WordPress itself, the theme, the plugins, the images you uploaded and wp-config.php. The database holds the content, the settings and the users.

The simple way for a business owner is a plugin like UpdraftPlus, which sends a copy to cloud storage outside your server. The manual way is to download the files over FTP and export the database. With either method, a backup is only worth something if you have checked that you can restore from it.

I arranged the steps below in the order I suggest checking a site whose backup status is still unclear. For each step I wrote how to spot a problem and how to fix it.

Step 1: what exactly should be in the backup

According to the official WordPress documentation, the files are everything in the WordPress folder on the server: the core, the themes, the plugins, the uploads folder, wp-config.php and .htaccess. The database is stored separately, usually in MySQL or MariaDB.

To know whether your backup is complete, open the latest backup and see what is inside. A SQL file without the wp-content folder, or a files archive without a SQL file, is a partial backup. And if the backup comes as several separate files, every one of them needs to be there.

So make sure every backup tool you use is set to back up both the files and the database. The WordPress documentation recommends treating the files and the database as one “backup set” created at about the same time, because a files backup from a month ago with a database backup from yesterday may not match each other.

Step 2: check what your hosting company already does

The WordPress documentation notes that most hosting companies provide a backup tool, and recommends checking with yours which services it offers. Before you install anything, find out what already exists.

Go into your hosting control panel and look for a backups area. If there is no list of backups with dates, or the latest date is old, you cannot rely on it. It is also worth asking support how long backups are kept, whether they include the database, and whether you can download a copy to your own computer.

And even if your host makes backups, keep a backup of your own somewhere else. A backup that is stored only on the same server will not help you if the server itself goes down or the account gets locked. The UpdraftPlus documentation says it directly: if something happens to the server or the hosting company, the backup goes with it.

Step 3: back up WordPress with UpdraftPlus

UpdraftPlus is a backup plugin whose free version includes manual backup, scheduled backup and restore from the dashboard. It is the most convenient way for anyone who does not want to touch FTP.

After installing it, the settings are under Settings > UpdraftPlus Backups. In the Backup / Restore tab there is a Backup Now button, which opens a window where you choose whether to include files, the database or both, and whether to send the copy to remote storage.

In the Settings tab you set two separate schedules: Files backup schedule and Database backup schedule. In the Choose your remote storage area you pick where the copies will be sent. According to the plugin page on wordpress.org, the free version supports Dropbox, Google Drive, Amazon S3, FTP and email, among others.

Signs of a problem are a Backup Now button that is not active, a backup that gets stuck halfway, or a backup that finishes without the copy reaching the cloud. And if you did not choose remote storage at all, the copies are saved only on the server.

According to the UpdraftPlus documentation, the common reasons for a failed backup are an old version of the plugin, a conflict with a recently installed plugin, an expired connection to the cloud service (in which case you reconnect to Dropbox or Google Drive), no space left in the cloud, and limited server resources. On a large site you can reduce the size of the parts with Split archives every in the expert settings. And if there is no clear reason, turn on the WordPress debug log and check wp-content/debug.log after another backup attempt.

Step 4: a manual backup, without a plugin

When the site does not load, or when you do not want to add another plugin, back up manually in two parts.

The files: the WordPress documentation says the easy way is to download all the WordPress files to your computer over FTP. The most important is the wp-content folder, where the themes, plugins and your uploaded files live, and also wp-config.php, which holds the database connection details.

The database through phpMyAdmin: log in to phpMyAdmin from your hosting panel, choose the site’s database, click the Export tab, choose Quick and click Go. You get a SQL file to download.

The database through WP-CLI: if you have SSH access and the server runs WP-CLI, the following command exports the database to a SQL file in the folder you are in:

wp db export --add-drop-table

Run it from the main folder of the site, the one where wp-config.php is located.

What to watch for here is an empty or suspiciously small SQL file, or an FTP download that was cut off halfway. Before you finish, open the SQL file in a text editor and check that it contains tables.

Step 5: where to keep backups and how often to make them

The WordPress documentation recommends keeping at least the last 3 to 5 backups in several different places: for example one on the hosting server, one in cloud storage and one on your computer. As for frequency, the recommendation there is a weekly backup for small sites and a daily backup for sites with a lot of activity. If you have a store or forms that come in every day, you are in the second group.

The most important recommendation on that page is to back up the database regularly, and always before an update, whether it is an update of WordPress, a theme or a plugin.

It is also worth remembering what the backup contains. It holds wp-config.php, which according to the WordPress documentation contains the database connection details, and the SQL file holds the site’s user details. So keep the copies in a private cloud account or on your own computer, and do not leave a backup file in a folder that can be reached from the browser.

In practice, in UpdraftPlus you set the schedules according to how fast the site changes and choose a cloud destination, and every so often you also download a copy to your computer. A WordPress backup that sits in only one place is a single point of failure.

Step 6: restoring a WordPress site and checking that the backup is valid

A backup you never tried to restore from is just an assumption. The WordPress documentation recommends making a manual backup from time to time to confirm that the automatic backup really works.

Restoring with UpdraftPlus: go to Settings > UpdraftPlus Backups, scroll to the Existing backups area and click Restore next to the backup you want. In the window that opens, choose what to restore: Plugins, Themes, Uploads, Others and Database. If the backup is saved on your computer or in the cloud, first upload it through the Upload backup files link.

Manual restore: according to the WordPress documentation, the order is the reverse of the backup. When you back up, you start with the database and then the files. When you restore, you upload the files first and then import the database.

Testing without risking the live site: if your hosting company provides a staging environment, restore there and not to the site itself. After the restore, go through the home page, an inner page, a form and the admin area.

When to stop and call an expert

If the site no longer loads and you are not sure where to start, there is a full order of checks in the guide on fixing a broken WordPress site, which starts from the backup. And there are situations where it is worth stopping and getting help:

  • The site is already down, and you have no backup you are sure is complete.
  • A restore failed halfway and the site is left in a partial state.
  • You need to restore only part of the data, for example the orders from the last few days, without overwriting everything else.
  • The error log shows errors you do not understand, or you have no FTP and phpMyAdmin access.
  • You are moving the site to another server or domain, which takes more than a regular backup.

In these situations every extra attempt can overwrite what could still be saved. And before any action, even when a professional steps in, make a full backup of the current state.

Frequently asked questions

What does a complete WordPress backup include?

All the site files, including the wp-content folder and wp-config.php, and the database. Without either of them you cannot return the site to the state it was in.

Is my hosting company’s backup not enough?

It helps, but it sits with the same provider. If there is a problem with the server or the account, the backup may be unavailable too. It is better to keep another copy in the cloud and one on your own computer.

How often should I back up?

The WordPress documentation recommends a weekly backup for a small site and a daily backup for a site with a lot of activity, and always a backup before an update.

Is the free UpdraftPlus enough?

For most small business sites, yes. The free version includes scheduled backup, sending to cloud storage like Google Drive and Dropbox, and restore from the dashboard. Incremental backup and support for more destinations are reserved for the paid version.

How do I restore a WordPress site when I have no access to the dashboard?

Upload the files over FTP or through your host’s file manager, then import the SQL file through phpMyAdmin. If you have not done this before, this is the situation where it is worth involving someone experienced.

Should I back up before updating even a single plugin?

Yes. The WordPress documentation recommends always backing up the database before an update, and a fresh backup is the fastest way to go back if a plugin update breaks something on the site. In UpdraftPlus it is one click on Backup Now before you update.

How do I know my backup is valid?

Restore it to a test environment and check that the site loads, the content is in place and you can log in to the admin area. A quicker check: open the archive and make sure it contains both files and a SQL file with tables.

Not sure your backup is really complete, or the site is already down and you cannot restore it on your own? Talk to me and I will check it.

Sources: the official WordPress documentation on backups and the official UpdraftPlus restore guide.

Have a project worth talking about?

The call is free, with no commitment 😊