Having your WordPress site backed up it’s very important and should be done by every person who has an WordPress site. Just think what will happen if someone will hack your site and remove all the files that you have, if something like this would happen for me it will be a tragedy and I will lost all my work that I have done.
This days doing automatic backups of your WordPress site it become easier and easier and also free, a lot of plugins have been developed that can help you to backup your site and have a easier sleep during the night. I have already written an article about how you can backup your entire site to Dropbox, the article can be found here: How To Backup Your WordPress Site To DropBox. In this article I would like to show you how to automatically backup your WordPress site to Google Drive.
Google Drive it’s quite new (only a couple of months) but it’s great because of the free 5 GB that you receive and of the possibility to have even more at a low price. So having a 5 GB online storage space it will not cost you anything, you just need to have an Google account and activate it. The plugin is also free and it can be downloaded from here: Google Drive for WordPress.
How To Automatically Backup Your WordPress Site to Google Drive
Below are the detailed steps that can help you to configure the plugin to automatically backup the site to Google Drive:
1. Install Google Drive for WordPress
Download Google Drive for WordPress or go directly in WordPress plugins => add new and search for it in the WordPress plugins database.
2. Configure your Google account to give API access to the plugin
After the plugin installed you will need to configure your Google account to give API access to the plugin. If you enter the plugin configurations you will see the below settings that needs to be configured:
- Click the ’Google API Console‘ and you will go to Google site where you will config your API.
- Go to ‘API Access’ tab and click on ‘Create an OAuth 2.0 client ID’.
- In the pop-up window, give a product name and upload logo (if you want )before clicking on “Next” button.
- By default “Web Application” will be selected and don’t change it.
- In “Your site or hostname” section, click on “More Options” to expand link sections. You have to paste the link from the second step the one give it in the plugin configuration plugin. Paste it in Authorized Redirect URIs, in Authorized Redirect URIs put you domain name like in the below picture and click “Create Client ID”
- Copy the Client ID and Client Secret from API dashboard and paste them in the plugin configuration page from step 2 and hit Alow access.
3. Configure the plugin
Now the plugin has the necessary access to Google Drive to do the backup. In this chapter we will see how you can configure the plugin to automatically do the backups on Google Drive.
- Backup Settings Configuration – here you will set the name of the file, if you wan’t to receive an email notification and how often the backup should be done. After just hit save.
- Manage Database - Check yes, if you want to keep Database backup –Check the option if you want to exclude particular tables from backup –Always keep a recent backup of your site.Here you have option to keep most recent backups. Select how many you want to maintain on your server. –If you want, you can move particular backup folder to google drive.
- Manage Files: wp-content files –Check option to exclude files from backup –Select how many backups you would like to maintain on your server. –If you want, you can move particular backup folder to google drive.
4. Check to see if the backup is done correctly on Google Drive
Do a one time backup from the plugin to start the manual backup or wait for the scheduled one to see if the backup is properly done. The backups will appear in My Drive as a zip one. Just download it and see if is containing the files that you need.