How To Backup Your WordPress Site To Google Drive

We all know that backing up a live WordPress site is a mandatory task for any site owner.

Storing backups in a remote location available from anywhere, is a sound strategy and anyone with a Gmail account has a cheap and easy solution.

In this Weekend WordPress Project, we’ll walkthrough how to use Google Drive as the remote store for those critically important site backups.

Weekend WordPress Project featured image
Storing your WordPress site backups on Google Drive is a sound strategy

There are many, many backup solutions available for WordPress that cover the full range of complexity.

Regardless of a solution’s features, the best backup solution is the one that is undertaken regularly and is easily understood. Bells and whistles count for nothing if they are never rung or blown.

What’s also important is to think about the reverse process. Backups are created with one thing in mind: to recreate the backed-up site as at a particular time and day. The worst-case scenario is recovering from disaster but backups can also potentially be used to create a test site, deploy a new site or “reset” a site (common for demo sites).

Easy access to the backup file is obviously essential, especially in a disaster scenario, and locating these files in the cloud makes a lot sense. Especially so when you factor in that disk failure is the most likely cause of a disaster scenario and will render any locally (to the website) stored backups unavailable.

There are, of course, a myriad of cloud options and amongst the more popular backup solutions DropBox and Amazon S3 are well catered for. The same can’t be said for Google Drive, however, which is a little surprising given that you get 15GB for free. More than enough to store a reasonable number of backups for an average WordPress site.

The upside of this lack of widespread support is that it makes choosing a backup solution much easier. For this Weekend WordPress Project, we are going to use the basic version of UpdraftPlus.

Configuring UpdraftPlus and Google Drive is a little fiddly but well worth it. At the end of this process you’ll have piece of mind knowing that regular site backups are readily available in a safe offsite location.

Step 1 – Install UpdraftPlus Plugin

UpdraftPlus' image from the WordPRess repository
One of the few free backup plugins that supports remote storage on Google Drive

You’ll find the UpdraftPlus plugin in the WordPress plugin repository or you can simply search for UpdraftPlus in the Plugins > Add New screen.

You can also read more about the plugin and the various premium features at the UpdraftPlus website.

Step 2 – Configure Backup Contents And Schedule

Jump to Settings > UpdraftPlus Backups and set up your preferred options for what is backed up on your site and the backup schedule.

Screengrab of the Configure Backup Contents And Schedule options for UpddraftPlus
The free version of UpdraftPlus offers good control of what gets backed up and when

Unless you post multiple times a day, then daily is likely to be sufficient (you can always run a manual backup if you make substantial updates to the site). As for the number of backups, this will depend on whether you think you’ll always be restoring to the latest backup or whether you want the ability to roll-back to a particular day.

Of course, you have the option to run different schedules for files and database and this is worth considering. Chances are that most files will be copies of files that you have stored locally or can easily re-download, so you may not need to backup as regularly as the database which is going to be an unique store.

Perhaps start with backing up files weekly and database daily.

Step 3 – Configuring Google Drive As The Remote Storage

This is where it gets a little fiddly. What we need to do is create a Google Project that uses the Drive API, set up remote access to the Project and then authorize the UpdraftPlus plugin to use the Project. Sounds more complicated than it really is.

First step, of course, is to tell UpdraftPlus that we want to use Google Drive so, select Google Drive from the Choose your remote storage dropdown.

The content will automatically update to give you guidance on how to complete the configuration, along with the all-important redirect URI. Don’t worry if this doesn’t make any sense, just copy the URI and head over to your Google API Console (if you have a Google account then you’ve got a console).

Create A Project

When the Console appears, click on Create Project.

Screengrab of the create project dialog
First step is to create a new Google Project

Enter a Project Name and Project ID that makes sense to you and click Create.

An Activity window in the bottom right-hand corner of your browser window will open displaying the progress of your project creation task. Once the task has completed, you’ll be taken to new project’s Project Dashboard.

Enabling The Google Drive API

We need to enable access to the Google Drive API for this project, so click on Enable an API.

You’ll presented with a list of the huge range of available Google APIs. Scroll down to Drive API and click on OFF.

A message will appear when the API has been enabled and Drive API will be listed at the top of the API list along with a number of other APIs that are automatically enabled when you created the project.

Screengrab of the list of enabled APIs for a Google Project
Add the Drive API to your Google Project

Allowing UpdraftPlus To Use The Drive API

You’ve now set up a Project that provides access to your Google Drive via an API. Now you need to enable UpdraftPlus to use that Project.

We’re going to jump around the menu items a bit, but it makes sense to do so. Go to your project’s API & auth menu and click on Consent.

This form is setting up the look of authorization confirmation that is displayed later in the process. There’s an example confirmation next to the form and if you’ve ever used a social network credentials to log into another site then you’ll already be familiar with the layout.

Screengrab of the Consent form in the Google Project Console.
Just select an email address and fill in a PRODUCT NAME to set up consent.

The form looks a little complicated but all you need to do is select an EMAIL ADDRESS (if it’s not already pre-selected) and fill in a PRODUCT NAME - I’ve used WP Back Up – and click on Save.

Next, we need to set up the Credentials.

Under your project’s APIs & auth menu, click on Credentials and under OAuth, click on Create new Client ID.

Screengrab of the Google Project Create Client ID dialog
Create the access credentials for users of the project

In the pop-up dialog, keep the selection as Web application, enter your site’s domain name in AUTHORIZED JAVASCRIPT ORIGINS and that URI you copied earlier into AUTHORIZED REDIRECT URI.

Click on Create Client ID.

The dialog will close and you’ll see a new table titled Client ID for web application.

Copy the CLIENT ID and the CLIENT SECRET from the Console to the Google Drive Client ID and Google Drive Client Secret, respectively, in the UpdraftPlus Settings.

Click on Save Changes at the bottom of the UpdraftPlus Settings screen.

Annoyingly, this will take you back to the Current Status tab, so click on the Settings tab and either click on the link in the notification at the top of the page or scroll down to Authenticate with Google and click on the linked text there.

You should get the following page (notice the product name – WP Back Up – that we set up in Consent) – click on Accept to allow access to your Google Drive.

Screengrab of the consent dialog
Request is vague but it’s asking consent for UpdraftPlus to access your Google Drive project.

You should automatically return to the UpdraftPlus settings (this is also part of the test) and you will see a notification with details about your Google Drive account.

A screengrab of the success notification from UpdraftPlus on successfully configuring Google Drive as a remote store
A modest message for getting through a fiddly process

Success, indeed. You have successfully configured Google Drive as a remote store for your backups.

Step 4 – Test With A Manual Backup

Before popping any champagne corks, though, you need to test the backup process.

On the Current Status tab of the Updraft Settings, click Backup Now.

A popup dialog will appear allowing you to do some basic configuration of what is backed up but let’s leave the options unchecked and give UpdraftPlus a thorough workout.

Click on Backup Now and watch as UpdraftPlus updates you on the backup’s progress.

Screengrab of the progress messages during a backup operation
UpdraftPlus does a great job of keeping you updated on its progress

When it’s finished, UpdraftPlus will tell you that ‘the backup apparently succeeded’, which doesn’t exactly inspire confidence. So, check that the backups have indeed been created.

Click on the Existing Backups tab.

Don’t be put off by the (0) in the title, it will change almost immediately. If the backup was successful you should see an entry in the Existing Backups list.

Of course, the real measure of success is the existence of your backup files on your Google Drive account.

Jump into Google Drive and look for a folder called UpdraftPlus (this name is fixed unless you go for the premium version of the plugin). Double-click on the folder and check it contains files. The number of files will depend on what you’ve selected to be backed up but generally UpdraftPlus will create separate files for the database, the plugins folder and the themes folder.

Screengrab of the UpdraftPlus folder in Google Drive
The only measure for success – are those backup files in your Google Drive?

You can now be confident that you are backing up to a remote location and the cornerstone of your Disaster Recovery Plan is now in place.

Restoring A Backup With UpdraftPlus

As I mentioned, a backup solution is really only as good as its restore and it’s probably a good idea to practice restoring rather than trying to break your duck under the pressure of a real disaster scenario.

Part of practicing is developing a run sheet – a list of the steps that you need to undertake to restore. It’s important to note, then, that UpdraftPlus does not back up your core WordPress files taking the approach that you can simply download these from the WordPress.org archives. This seems a pretty sensible approach to focus only what is likely to be unique on a WordPress installation.

In a complete disaster recovery situation, you are likely to be looking at:

  1. Downloading and running the installation process for the appropriate version of WordPress
  2. Install and reconfigure the UpdraftPlus plugin
  3. Restoring the database, plugins, themes and uploads (if backed-up) folders

If you want to just roll-back to a particular backup then you can do this in situ by hitting the Restore button next to any backup. Again, just as with the backup process itself, UpdraftPlus does a good job monitoring progress.

Worth The Time And Effort

There is practically no scenario where backing up is not worthwhile. Disk failures, host failures, security failures can all leave you up that proverbial creek and if you don’t have a backup of your site to fall back on then you are definitely paddle-less.

Setting up UpdraftPlus to backup to Google Drive can be a little fiddly, especially if you haven’t created a Google Project before, but it’s well worth the perseverance to have those backups stored remotely.

And well worth 15 minutes of your time this weekend.

Comments (16)

  1. Hi Chris, thanks for the information !

    I did installed UpdraftPlus last Week to test it and It looked nice. After that though, I remembered that my host was giving me a native backup solution for 30 days.

    I would like to know if you would suggest to use another backup solution than the native one.

    Thanks!

    Sylvain

    • Hi,

      Thanks for trying UpdraftPlus!

      Personally, I wouldn’t recommend leaving backups solely in your hosting company’s hands, because then you have a single point of failure. If your hosting company goes bankrupt, gets hacked, or makes an accounting error and deletes your account, or if you have a dispute and they hold your account to ransom, etc., then you could then lose your site and your backups all at once.

      Best wishes,
      David

      • I hear you. I’m evaluating backup solutions right now and for what I can read, none speak of multiple backup solutions. Still, as a computer technician I know this is a common thing to set up. I’ll try setting up a second backup plan then.

        Thanks for your answer David

        Sylvain

  2. Hi Chris,

    Thanks very much for this! (I am the main developer of UpdraftPlus).

    As far as I know, UpdraftPlus is the *only* current free WordPress plugin that can back up to Google Drive (there are two others that have not been updated for 2 years, and which are using an old Google API that will be withdrawn completely in a few months).

    “Annoyingly, this will take you back to the Current Status tab, so click on the Settings tab and either click on the link in the notification at the top of the page” – the notification also shows at the top of the “current status” tab as well. So there’s no need to either change tabs, or to be annoyed! :-) Screenshot: http://snag.gy/fXNi4.jpg

    I won’t be checking this thread often to see if anyone’s asking for support – if anyone does want support, then please use one of the official channels list at: http://updraftplus.com/support/

    Best wishes,
    David

  3. REALLY great tutorial!

    One problem I ran into was the continual “invalid client” when I went to authenticate (I had followed the instructions exactly–I’m not a complete noob!)

    After banging my head against the wall I went into the “Consent Screen” under the “API & auth” tab and specified my email address. Perhaps this is an issue for me because I manage about a dozen Google Apps accounts. I may have been confusing the authentication process.

    After I did that the Updraft did its thing and I’m successfully running a manual backup!

    Thanks again!

    • I’m stuck at the same exact step! I tried your suggestion of selecting my email address under consent screen, but it’s still giving me the “invalid client” error message. Any advice? I was really hoping to get this done so I can backup before I update to WP 4.0!

  4. I’ve always used “backup” https://wordpress.org/plugins/backup/ – but concerned now that it’s one of the ones mentioned above using the about-to-expire api.

    Nevertheless, it’s been solid and 100% free. I think the low star rating is due to the not so user friendly set-up (same as detailed in this article). Personally I’d give it 5 stars.

  5. Anyone had any experience with Backup-Buddy from ithemes?

    Just wondering, the 100$ for 10 sites for 1 year is cheap – and you can blame someone else if everything goes to **** :-)

    And thanks for the always great articles!

Participate