Skip to content

Automatic Database Backup to Google Drive

Ensuring the safety of your data is critical for uninterrupted business operations. Easy Instance simplifies database backup management by offering automated background backups to multiple secure storage options, including Google Drive.

This guide specifically covers how to configure automatic backups to your Google Drive account.


1. Create a Google API Project

To start, you need to enable the Google Drive API in the Google Cloud Console.

  1. Log in to the Google Cloud Console.
  2. Create a new project (or select an existing one).
  3. From the sidebar, select APIs & Services > Library.

Enable API

  1. Search for Google Drive API and click on it.

Search API

  1. Click the Enable button.

Enable Drive API


2. Create Credentials

After enabling the API, you need to set up the authentication credentials.

  1. Navigate to the OAuth consent screen tab.
  2. Create the project configuration by following the "Get Started" guide.
  3. Go to the Credentials tab.
  4. Click Create Credentials and select OAuth client ID.

Credentials Setup


3. Configure Authorized Redirect URI

  1. Select Application Type as Web Application.
  2. Under Authorized JavaScript Origins, add URL of main page (e.g., https://easyinstance.com).
  3. Under Authorized Redirect URIs, add the redirect url shown in the backup configuration page.
    • Example: https://web.easyinstance.com/google_drive/authentication

OAuth Configuration

  1. Click Create. A dialog will appear showing your Client ID and Client Secret. Copy these credentials securely.

Client ID/Secret Generation

  1. Important: Go back to the OAuth consent screen. Under the Test users section, add the Gmail address you are currently logged in with to allow access to the application while it's in testing mode.

Test User Configuration


4. Configure Easy Instance Settings

Now, apply these credentials to your Odoo instance.

  1. Open your Odoo instance and navigate to the Backup Configuration.
  2. Enter the Client ID and Client Secret obtained in the previous step.
  3. Folder ID: Go to your Google Drive, open the folder where you want to store backups, and copy the ID from the URL (the string of characters after folder/).

Folder ID Identification

  1. Click Setup OAuth Token. You will be redirected to a Google authorization page.

Token Setup

  1. Grant the necessary permissions and click Continue.

Authorization Flow

  1. Once the token is generated successfully, your backups will be uploaded to Google Drive as per the defined schedule.

Manual Backup

If you want to trigger a backup immediately, you can use the Backup Now button.

Manual Backup Confirmation


Tip: If you ever need to change accounts or update credentials, you can use the Reset Token button to refresh the authentication.