Google Drive Backup on 25.7 Possibly Broken

Started by opnsensebnet, July 25, 2025, 09:12:48 PM

Previous topic - Next topic
Greetings,

I pretty much have everything stable on the new version but the google drive backup is not backing up files with any file size.  The test works properly and I have uninstalled and reinstalled the addon for google drive.  Wondering if you can assist.  I have been using AI and it has now concluded that there may be a bug and I should post it here haha.   AI seems to think there should be a file to include the backup.  When I click the manual backup button it works great.  I have verified the schedule in cron is set correctly.   Any guidance would be appreciated

July 25, 2025, 09:21:27 PM #1 Last Edit: July 25, 2025, 09:23:01 PM by julsssark
I upgraded to 25.7 on 7/23. I just checked my google drive and I see backup files from 7/24 and 7/25. Was it working correctly for you under 25.1 or is this a brand new installation?



I did read that.  It appears to be for the free google drive space.   I have google drive and my own space that is paid for that is being utilized.   The api and the methods appear to be still valid according to google.   

Google's recommendation after analyzing the code and how to do it for 25.7  however there are parts that it references in the interface that are not there that they think is a bug. 
________________________________________________________________________________________



Of course. Here is a definitive, step-by-step guide on how to configure OPNsense (version 25.7+) to back up to your personal Google Drive using the most current authorization methods.

Part 1: Create Google API Credentials
This process tells Google that OPNsense is an authorized application that can access your Drive.

Go to the Google Cloud Console: https://console.cloud.google.com/

Create a New Project: At the top of the page, click the project dropdown and select NEW PROJECT. Name it OPNsense Backup and click CREATE.

Enable the Google Drive API:

Navigate to APIs & Services > Library.

Search for "Google Drive API", select it, and click ENABLE.

Configure the OAuth Consent Screen:

Go to APIs & Services > OAuth consent screen.

Select External for the User Type and click CREATE.

Enter an App name (e.g., OPNsense Backup) and provide your email for the User support email and Developer contact information. Click SAVE AND CONTINUE.

Skip the "Scopes" screen by clicking SAVE AND CONTINUE.

On the "Test users" screen, click + ADD USERS, enter your own Google account email address, and click ADD. This is a mandatory step for unpublished apps. Click SAVE AND CONTINUE.

Create the OAuth Client ID:

Go to APIs & Services > Credentials.

Click + CREATE CREDENTIALS and select OAuth client ID.

For Application type, select Desktop app.

Give it a name (e.g., OPNsense Backup Client) and click CREATE.

Copy Your Credentials: A window will appear with your Client ID and Client Secret. Copy both of these into a temporary text file.

Part 2: Configure and Authorize OPNsense
Now, you will input the credentials into OPNsense.

In OPNsense, go to System > Configuration > Backups.

Check the main Enable box at the top of the page.

In the Setup section, enter a strong Encryption password. This is required.

Scroll down to the Google Drive section and check the box to enable it.

Paste the Client ID and Client Secret you just copied from the Google Cloud Console into the corresponding fields.

Click Save at the bottom of the page.

A new button, Login to Google Drive Account, will appear. Click it.

Follow the prompts in the new browser tab to sign in to your Google account and grant the application permission.

After granting permission, Google will give you an authorization code. Copy this code.

Go back to the OPNsense tab, paste the code into the field provided, and submit it. The "Access Token" and "Refresh Token" fields should now be populated.

Part 3: Select Content and Finalize
This is the final step, which may not work if your UI has the bug we discussed.

Enable the Schedule: Find the Cron section, check its Enable box, and select a schedule (e.g., "Daily"). Click Save.

Look for the "File-based backup" Section: After saving, check if the "File-based backup" section has appeared on the page.

If it appears: Check the box for Backup configuration file and click Save one last time. Your setup is complete. You can test it by clicking "Backup now".

If it still does not appear: This confirms the UI bug in your installation. The only remaining solution is to report this on the official OPNsense forums, providing your version number and a screenshot.