Hosting Tutorial & Guide

How to Back Up and Restore a WordPress Site Easily

updated on Dec 10, 2015
How to Back Up and Restore a WordPress Site Easily Backing up your WordPress site on a regular basis is important because it gets you covered in the unexpected accident that something goes wrong with your site. If you have a well-maintained backup, no matter when there is a crash due to misconfigurations or malicious attack, you can easily restore your site and make it function again in minutes.

Creating a backup and making a restoration may sound complicated, but in fact, they do not require much technical knowledge. Even beginners can handle the tasks as long as carefulness is taken.

To offer a guide for beginners, we are here introducing some of the easy ways to back up and restore a WordPress site. You can pick up the method that you feel comfortable with.

How to Back Up a WordPress Site

First of all, you need to know that a complete backup of a WordPress site includes two main parts:
  • A backup of the database where all the website content including posts, comments and links is stored.
  • A backup of the website files, including images, plugins, themes, code files and static web pages.
Generally speaking, there are two ways you can choose to create a WordPress backup: taking all steps manually, or automating the backup with a plugin. Both are explained in below.

Method 1: Create a manual backup

To create a backup manually, you will need to use at least two tools. phpMyAdmin is required for exporting the database as a compressed file, and cPanel or an FTP client allows you to copy the files on your server to the local computer. These tools are all easy-to-use.

For the detailed steps of using cPanel and phpMyAdmin to back up a WordPress site, you can refer to this data backup tutorial. And if you are using other control panels like Plesk and Direct Admin, this guide in WordPress Codex should help. With these resources, we do not discuss the steps of making a manual backup again in this post.

Here is a suggestion that you should keep a minimum of three backups of your site files in case that any one is lost or corrupted. Another advice is to store the backups in different places.

Method 2: Automate and schedule a backup with plugin

There are a number of WordPress backup plugins which are well developed and maintained. Compared with the manual way, plugins save the time and effort by allowing you to automate backups. If you are new to WordPress, this method is highly recommended.

As backup plugins function in a similar way, we will take a free plugin named BackWPup as an example and explain how to use it to make a backup.

BackWPup Plugin

After installing and activating the plugin, you will see a menu item named BackWPup has been added to the WordPress dashboard. Now you have several things to do.

The first task is to create a backup job by clicking on the "Add new job" menu. Under the General tab, you need to:
  • Give the job a name. This is for internal identification, so you can name the job the way you like.
  • Select the tasks. Which tasks to choose depends on what you want to back up. If you'd like to create a complete backup of your site, you can select all options except for checking and optimizing the database tables.
  • Select the archive format. The default option is tar.gz, but you can also choose others like zip and tar as you want.
  • Select the destination that the backup file is stored. There are multiple choices including "sent via email", Dropbox, FTP and S3 Services, and you are able to choose one depending on your preference. For the sake of security, remember not to store the backup file on the same server as your WordPress site.
Add a New Backup Job

Then, the second task is to schedule the backup job. Under the Schedule tab, you can specify how often the backup is performed – hourly, daily, weekly or monthly with the WordPress Cron. If you choose the manual operation, the plugin will not back up your site unless you run the job manually. Also, developers have some other choices like starting the job with a link or with WP-CLI.

For beginners, we would recommend using WordPress Cron to automate a weekly backup. Daily is also good if you make changes to your site frequently.

Schedule a Backup Job

On the next tab named DB Backup, you can change the settings of database backup. Here you are able to choose which tables to back up, change the name of the backup file, and decide whether to compress the file. For the database tables, you can uncheck the ones that are created by plugins since they are not crucial to your site. But if you are unfamiliar with the tables, you'd better get all of them backed up.

Configure Database Backup

Then, the Files tab allows you to select the folders that need backup. In this section, you can include or exclude the content folder, plugins, themes, and more. We would recommend not backing up the install folder. But remember, the uploads folder must be included in the backup job.

Select Backup Folders

The last task is to configure the destination of the backup files. Depending on the destination you choose, you will see a tab for it under which you need to give the information required for storing the backup files. Just follow the simple guidance to get your FTP server, email address, Dropbox or other destinations configured.

After the changes are saved, the job starts running on the specified time. If you want separate backups for the database and files, you can also create multiple jobs. Besides, you can run a backup job manually at any time by clicking on the "Run now" link under the job name. Just experiment more to see the possibilities.

Run a Backup Job Manually

How to Restore a WordPress Site

Since the backup of a WordPress site includes two parts: the database and site files, the restoration process will also cover two steps: the restoration of the WordPress database, and the restoration of website files. Details are explained in below.

Step 1: Restore the database

Firstly, you should get a database prepared for the restoration. You can do this by cleaning up your old database or creating a new one. Here we will discuss the former method and assume that the old database still exists.

Now, log into your hosting control panel, find phpMyAdmin and click to access it.


Open your WordPress database, and you can see a list of tables. Scroll down and check the box before "Check All". Then in the dropdown, select "Drop".

Drop All Tables

After confirming to drop the tables, you will get an empty database a few seconds later. What you have to do now is to click on the "Import" tab, select the backup .sql file and upload it to the database. The uploading and importing are automated, so you do not need to worry about anything.

Import Database

If everything goes fine, you will see a list of database tables under the "Structure" tab.

Step 2: Restore website files

Restoring files are easy no matter you are using cPanel or an FTP client to connect to your server. However, there are still several things to pay attention.

If you want to restore a corrupted or hacked site, it is suggested to delete all the existing files on your server first. But before doing this, you have to make sure your backup is complete and up-to-date.

To delete WordPress files and directories, you only need to access them with cPanel or FTP, select all the files in the root directory of your WordPress site, and delete them. In cPanel, the root directory can be accessed via File Manager.

File Manager

The next step to take depends on what your backup files include.
  • If your backup contains the WordPress core files, just upload them to your server.
  • If your backup does not include the WordPress install, you will have to install a fresh WordPress first, and then upload the backup files to your server. Remember to extract the files.
Besides, if your site was hacked and you are not sure whether your backup files are clean without any malicious code, you'd better restore the themes and the files in the /wp-content/uploads folder only, and abandon other files.

In this case, you have to make a new wp-config.php file, and download the plugins you used one by one. More works are required, but they can help you clean up the malware and malicious code completely.