How to Set Up the Google Drive API
This document explains how to set up your Google Drive™ account with backups.
Set up the Google Drive API for your Google account
To create a Google Drive account, visit the Google® Create your Google Account page.
To configure the Google Drive API for your Google account, perform the following steps:
- Navigate to the Google API Manager website.
- In the left navigation menu, click Library.
- Under the G Suite heading, click GoogleDrive API.
- Click Create Project, and then click Create. A new menu will appear.
If the new menu does not appear, perform the following steps and then proceed to Step 5:
- Click Credentials in the left navigation bar.
- Enter your new project name and click Create.
- Click Enable.
Increase your Google Drive API quota
According to Google’s documentation, Google imposes limits and quotas on their APIs. This causes errors when you back up your server to Google Drive.
To avoid errors due to these limitations, we recommend that you perform the following steps to increase your default quota settings:
- In the side navigation bar, click Google Drive API.
- Click Quotas.
Increase the value of the Queries per 100 seconds per user setting.
The maximum value of 1000 usually resolves these errors. However, a lower setting may sufficiently resolve most errors.
- Click Done.
Create your account credentials
To set up your account credentials for backups, perform the following steps:
- In the side navigation bar, click Credentials.
- Click Create credentials.
If you already possess Google Drive account credentials, click Create credentials and then click Help me choose.
- From the Which API are you using? menu, select Google Drive API.
- From the Where will you be calling the API from? menu, select Web Server.
- From the What data will you be accessing? menu, select User Data.
- Click What credentials do I need?.
- In the Create an OAuth 2.0 client ID. text box, enter your desired name.
In the Authorized redirect URIs text box, enter the
hostnamerepresents your server’s hostname.
To locate your server’s hostname, perform either of the following actions:
- Run the
hostnamecommand as the
- Navigate to WHM’s Change Hostname interface (WHM >> Home >> Networking Setup >> Change Hostname). The server’s hostname appear’s under the Current Hostname heading.
- Run the
- Click Create. The interface will display your new client ID and client secret.
- We strongly recommend that you save these credentials in a secure location. Step 7 of the Create a Google Drive transport procedure requires these credentials.
- You can also download a JSON file with your client ID and client secret, or access them in the Credentials section.
- Click Done.
Create a Google Drive transport
If you experience problems when you perform these steps, check your browser’s popup blocker. Popup blockers may prevent your ability to perform this task successfully.
To create a Google Drive transport, perform the following steps:
- Log in to WHM as a
- Navigate to WHM’s Backup Configuration interface (WHM >> Home >> Backup >> Backup Configuration) and scroll to the Additional Destinations section.
- From the Destination Type menu, select Google Drive™.
- Click Create new destination.
- Enter your desired destination name.
- Enter the desired folder in which to store backups.
If you do not specify a folder, the system will store backups in the top-level folder.
- Enter your client ID and client secret.
- Click Generate Credentials to generate the credentials file. A new tab will appear that allows you to authorize access to your Google Drive data.
- Click Authorize Access.
- In the Timeout text box, enter the desired timeout duration.
- Click Save Destination.
- To validate your remote destination, click Save and Validate Destination.
- If you do not authorize access to your Google Drive data, this action will fail.