How to Backup a WordPress Site
Things will and do go wrong with WordPress and you need to be ready. In this tutorial, we are going to cover how to backup a WordPress site.
We are going to leave nothing to chance. I will cover how to do backups using three methods:
- Your hosting provider
- A plugin
- Manual backup
You should use all these backup methods. That's right all methods!
When you are preparing to backup your site you need to think about the worst-case scenario. Each backup method can get you out of tricky situations. You will thank yourself that you followed this tutorial.
If you are running a WordPress site you need to know how to do a backup and how to restore your backup. Check our guide on how to restore a WordPress site.
There is a lot to cover. Let's get started.
What do I need to Backup?
There are two parts to a WordPress backup:
- The database - this has your posts, comments and configuration settings
- The files - this includes HTML, CSS, JavaScript, plugins and themes
When you create a backup on WordPress you need to backup both of these to perform a full backup.
Each of the three backup methods we cover will backup both the files and database.
How often should you do a backup?
How often should you do a Backup?
To cover yourself you want the following backup schedule:
- Daily backups for the last 7 weeks
- Weekly backups for the last 5 weeks
- Monthly backups for the last 12 months
Don't worry you do not have to do all this yourself. We will cover how you can automate the backup of your site.
This schedule will cover you for any situation where you need to restore your site. Your hosting provider will follow a similar schedule for their automatic backups.
Even if you have a new site and you don't post new content daily, there can still be new content such as comments. Having a daily backup means that you will not lose these comments.
There is also one other time that you should create a backup and that is before you install a new plugin. Sometimes a plugin installation can go wrong. When it does you may need to restore a backup.
Later we will cover how to create a backup before each plugin installation.
How Many Backup do I Need?
With this backup schedule, you would keep 24 backups at any one time. I store these backups in cloud storage such as Google Drive so that I can get the backup when needed.
I will show you how you can use a free backup plugin that can do this for you.
Next, let's look at the backups your hosting provider does.
Backup WordPress Using a Hosting Provider
Your hosting provider will take their backups of your site (sometimes it is a premium feature). For example, Bluehost creates daily, weekly and monthly backups. Yet, they also state that you should not rely on them:
We do offer complimentary backups for our customers. They are created on a daily, weekly and monthly basis. These backups are not guaranteed in any way. We highly recommend all Bluehost customers create and manage their backups.
To rely on your hosting provider backups you will need to pay. Backups are a premium feature as part of higher-paid plans. If you can afford it you should go with a plan that does regular daily, weekly and monthly backups. You may never use them but it's good to know that there is always a fallback if needed. But don't rely on this as your only backup method.
If there was an issue with your hosts’ backup process then you could lose the data of your site. Your hosting provider backups should be a last resort and you should do your own backups.
Next, we are going to cover two ways you can do these backups, one using a free plugin and also how to do a manual backup.
Backup WordPress Using a Plugin
Now that we have backups with the hosting provider we now need to look at how we can make our backups. There are two ways to do this, the first is with a plugin.
The backup plugin to use is UpdraftPlus and it is free.
You can install the plugin by going to the admin area of the WordPress site and choosing plugins->add new:
Then search “UpdraftPlus” it will look like this:
Select the “Install Now” button and then click “Activate”:
To create a backup click on “Settings” and then “UpdraftPlus Backups” on the side menu:
It is a good idea to do your first backup so click the big “Backup Now” button:
Leave the default settings, this will backup the database and the WordPress files:
Once the backup is complete will be able to see it listed in the “Existing Backups section”:
You can find all the backups that UpdraftPlus creates here. This allows you to restore the backup if needed.
Once you have created your first backup you should now set up automatic backups. To do this click on the settings tab and choose a daily schedule:
You can then select where to send it, as I have mentioned it is a good idea to send this to the cloud such as Google Drive. There are also other options:
The email option can be a good one when you are getting started. Select email and then leave the default settings. The plugin sends the email to the WordPress admin email address.
Make sure to click save.
You will then get a daily backup email.
I also use this plugin to create a backup before installing a plugin. Click the “backup now” button before installing the plugin. If something does go wrong with the plugin installation then you can restore.
The free version of the plugin allows for a simple daily schedule. For a more complicated schedule take a look at the premium version of the plugin.
The last backup method we are going to cover is a manual backup. Do this once per month as the process is slower but worth it. You will have another backup that you can restore if needed.
Let's look at how to do this next.
Backup WordPress with a Manual Backup
When you do a manual backup of WordPress you need to use two tools. Remember we said earlier that there are two parts to a WordPress backup:
- The files - this includes plugins and themes
- The database - this has you posts and configuration settings
The two tools that you need are your sites File Manager and a database tool called PHPMyAdmin. Both of these tools are in the admin area of your hosting provider.
Let's look at how you can use them.
Backup files from the File Manager
To backup the files of your site, you need to use the file manager from your hosting provider. The location of the file manager will change depending on your host. You can often find it in the main CPanel area or admin area on your hosting provider.
Once you have located the file manager for your site you will see a list of all the files. It will look something like this:
If you can see folders like wp-admin
, wp-content
and wp-includes
then you are in the right place. You need to select all the folders and files and then choose to compress them:
Make sure to choose the zip option and give the backup a useful name such as backup-april-2020.zip
. Then choose compress:
The zip file creation may take some time depending on how big your site is. You can then download the zip file to store on your laptop:
Once downloaded move it to some cloud storage for safekeeping in Dropbox or Google Drive.
Backup the Database using PHPMyAdmin
Now we have a file backup we need to do the same with the database. The tool we use for this manual backup is PHPMyAdmin.
Your hosting provider will have a link to this tool either on the CPanel or the admin area:
The tool is quite old fashioned in its design and allows you to get direct access to the database settings. It looks like this:
On the left-hand side of the screen you should see the list of databases:
If you see a database named information_schema
you can ignore this. In the image above, the database has a strange name. To check that it is a WordPress database by looking at the contents. Click on the database name to expand the tables of the database:
If you see tables like:
wp_comments
wp_posts
wp_users
Then this is your WordPress Database and we can now do a backup. With the database selected click the “export” tab:
For this backup, we can keep the default settings of a “Quick” export. This means that it will backup the database and the data. It will then export it as a single file. Leave the format as “SQL” and click the “Go” button.
This will download a .sql
file to your downloads folder on your laptop/computer. Take this file and move it to cloud storage with the zip file you created above.
Congratulations, you have completed a manual backup of WordPress! That is all there is to it, set a calendar reminder to do this once a month on the last Friday of each month so you don't forget.
Wrapping Up, How to Backup a WordPress Site
We have covered a lot in this tutorial. You have learned how to backup a WordPress site using three methods:
- Hosting provider
- UpdraftPlus
- Manual backup using File Manager and PHPMyAdmin
You now know that there are two parts to a WordPress backup:
- The database - this has your posts, comments and configuration settings
- The files - this includes HTML, CSS, JavaScript, plugins and themes
You have learned that you need to have a schedule of backups and you need to keep 24 backups at any one time. The 24 backups should cover:
- Daily backups for the last 7 weeks
- Weekly backups for the last 5 weeks
- Monthly backups for the last 12 months
You should follow all three methods for your backups. The first is your hosting provider. Choose a host that will offer automatic backups of the server and don't rely on these. This is the last resort and can help you if all other backups have failed.
The second method uses the free plugin UpdraftPlus. This plugin will allow you to create automatic backups and easily restore them.
The last backup method we covered was to do a manual backup using the tools:
- File Manager
- PHPMyAdmin
Both of these tools can be found in the admin area of your hosting provider.
Lastly, remember to store your backup files in the cloud. Cloud storage will allow you to grab a backup in the future when needed.