How to Configure Google Drive as a Backup Additional Destination


Last modified: November 4, 2020

Overview

This document explains how to set up your Google Drive™ account as an Additional Destination in WHM’s Backup Configuration interface (WHM >> Home >> Backup >> Backup Configuration).

Set up the Google Drive API for your Google account

Note:

To create a Google Drive account, navigate to the Google® Create your Google Account website.

To configure the Google Drive API for your Google account, perform the following steps:

  1. Navigate to the Google API Manager website.
  2. In the left navigation bar, click Library.
  3. In the left navigation bar, click G Suite.
  4. Click Google Drive API.
    • If the API is not enabled, the Enable option will appear.
    • If the API is enabled, the Manage option will appear.
  5. Click Enable or Manage. The Dashboard will appear.

Create your account credentials

To set up Google Drive account credentials for backups, perform the following steps:

  1. Navigate to the Google API Manager website.
  2. In the left side navigation bar, click Credentials.
  3. Click Create credentials.
  4. Click Help me choose.
  5. From the Which API are you using? menu, select Google Drive API.
  6. From the Where will you be calling the API from? menu, select Web Server (e.g. node, js, Tomcat).
  7. From the What data will you be accessing? menu, select User Data.
  8. Click What credentials do I need?.
  9. In the Create an OAuth 2.0 client ID. text box, enter your desired name.
  10. In the Authorized redirect URIs text box, enter the https://hostname:2087/googledriveauth/callback link, where hostname represents your server’s hostname.
    Note:

    To locate your server’s hostname, perform either of the following actions:

    • Run the hostname command as the root user.
    • Navigate to WHM’s Change Hostname interface (WHM >> Home >> Networking Setup >> Change Hostname). The server’s hostname appears under the Current Hostname heading.
  11. Click Create. The interface will display your new client ID and client secret within these interfaces.
    Important:
    • 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.

Increase your Google API quota

According to Google’s documentation, Google imposes limits and quotas on their APIs. This can cause 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:

  1. Navigate to the Google API Manager website.
  2. In the left side navigation bar, click Google Drive API.
  3. Click Quotas.
  4. Increase the value of the Queries per 100 seconds per user setting.
    Note:
    A maximum value of 1000 usually resolves these errors. However, a lower setting may sufficiently resolve most errors.
  5. Click Done.

Create a Google Drive transport

Warning:

While you perform these steps, disable any popup blockers in your browser to prevent errors.

To create a Google Drive transport, perform the following steps:

  1. Log in to WHM as a root-enabled user.
  2. Navigate to WHM’s Backup Configuration interface (WHM >> Home >> Backup >> Backup Configuration) and scroll to the Additional Destinations section.
  3. From the Destination Type menu, select Google Drive™.
  4. Click Create new destination.
  5. In the Destination Name text box, enter a display name for this backup destination.
  6. In the Folder text box, Enter the desired folder in which to store backups.
    Note:
    If you do not specify a folder, the system will store backups in the top-level folder.
  7. Enter your Client ID and Client secret.
  8. Click Generate Credentials to create the credentials file. A new tab will appear that allows you to authorize access to your Google Drive data.
  9. Follow Google’s directions to authorize access to your Google Drive.
  10. When the message Credentials successfully generated appears, close that browser tab to return to the tab with the WHM interface.
  11. In the Timeout text box, enter the desired timeout duration.
  12. Click Save Destination.
    Notes:
    • 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.

Additional Documentation