AmoghDesai.com

How to Backup WordPress site and Database to Google Drive

I use a free theme for this blog and recently received an update.  Though I don’t remember making any customization, I dint want to risk messing with the theme after upgrade and needed something to backup my site for easy restore.  I know, use FTP to download the site and phpMYAdmin could easily backup my database.  But then, if I could set up a regular automated backup with some one click restore solution, that’d set me up for a long term and the site will be safeguarded too.  I set on a hunt (yeah! a google search :D) and the found an easy fix.

A plugin which once set can regularly and automatically backup your WP site files and database to Google Drive.  You can also backup to other services like Onedrive, Drop Box, Amazon S3, etc., but the free option lets you set up only one option at a time.  I only need the Google Drive option for now.  So let’s see how to set this up.

You start with installing the plugin on your wordpress site, and the easiest method is by login into your WP admin login go to Plugins => Add New

Now search and install the UpdraftPlus plugin.

Once installed go to Settings => UpdraftPlus Backups.

On the UpdraftPlus page Click on Settings and select Google Drive.  Now scroll down and copy the text from the red box below:

Now we will move on to create a Google drive project and enter the above copied link to the api for authentication and syncing of backups.  Start by logging into the Google Api Console.

Start with creating a New Project (drop down at top left corner) and name it as ‘Wp Backup’ or similar and click Create.

 

Scroll down to Google App APIs and click on Drive API and click on Enable.  Once enabled click on Credentials. Then click the tab OAuth Consent Screen.

Select your email ID and Enter a product name like ‘Wp Backup’.  Click on Save.

 

 

 

On the next screen, click Create credentials and select OAuth client ID from the drop down.

Now select Web application enter a name like ‘wp Backup Web client’.  Under Authorized Javascript origins enter your domain name like https://amoghdesai.com and under Authorized redirect URIs paste the link you had earlier copied from the UpdraftPlus settings. Click on Create.

 

You will now see a client ID and client secret.

Come back to the UpdraftPlus Settings screen, scroll down and paste the Client ID and client secret to the fields shown below, save changes and click on the Authenticate with Google link marked in yellow.

On the next screen, click on Allow access and you are all set for the taking backups.  Now go the the Current Status tab and click on Backup Now.

Once complete, also check your Google drive for new folder called UpdraftPlus and the newly created backup.  You can now move back to Settings tab and setup automated regular backups and number of backups you want to retain.

You are now all set with regular and automated backups stored straight into your Google Drive.  Let me know if this helped you or if there are any issues that you are facing or if you know of any other plugin to do this job better, in the comments below.