Support

Akeeba Backup for Joomla!

#41387 Google Drive backups

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
5.2.1
PHP version
8.2
Akeeba Backup version
9.9.11

Latest post by nicholas on Thursday, 28 November 2024 04:00 CST

j2studio

I am trying to configure Backup to go to a client's Google Drive. They set up a directory for this purpose.

I have access to this directory through my Google account in "Shared With Me".

I cannot seem to get a directory "path" from Drive to add to the "Directory" field in backup configuration. It only offers me a link.

When clicking "Reload the list of Drives", only Google Drive (personal) shows, even though I have Upload to Shared with Me folders selected. Can you help me figure out how to do this?

The backup I took actually did go to Google Drive, but not where I wanted it. I am sure it is because I used the "Share" link for the backup directory.

Please see screenshot.

 

nicholas
Akeeba Staff
Manager

You cannot share an entire drive in Google Drive, you can only share a folder. That's why you don't see it in the drop-down. The drop-down only applies to GSuite Google Drive accounts where each user has their own personal drive but can also have access to some of the organization's Team Drives. Since you and your client do not have an account under the same GSuite organisation you will never see their drive.

Your client must share the folder with you giving you Editor privileges. Below you can see what they will be seeing on their end, when they right click on the folder and select Share. Note the circled part. That's the privileges I am talking about.

This will send you an email. Open the link to accept the invitation.

Make sure you do NOT have a same-named folder in your Google Drive. If you do, delete it, then go to Trash and delete it forever. If you only do a delete without going into the Trash, Google in its infinite wisdom will make it so that we end up uploading the backup into the trashed folder, since they won't tell us it's actually trashed 🤦🏼

In Akeeba Backup's Configuration page you connect to your Google Drive as always, select your Personal Google Drive (Shared With Me folders act as an extension of your Personal Google Drive!), and as the Directory to upload to you enter the name of the Shared With Me folder, in this example it's /AkeebaDev Backups. Set Upload to “Shared With Me” folders to Yes. The file will be uploaded into the shared folder with that name instead of a new folder in your drive.

Or, at least, that is the theory. I have found this to be very inconsistent. Sometimes the Google Drive API returns the Shared With Me folder and everything works as described, sometimes (same drive, same folder) it does not. Google's documentation is useless at best, and their support non-existent.

I would recommend asking your client to do the login to Google Drive by visiting https://www.akeeba.com/oauth2/googledrive.php?callback=blank:// and give you the Access and Refresh Tokens displayed at the end of the process. You can copy them to the configuration page of Akeeba Backup to configure it, without having to click on Authentication - Step 1. This will actually be safer for you too. If the client fires you in the future your personal Google Drive's credentials won't be left for the next Super User to see when they configure Akeeba Backup.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager

So, it looks like Google changed the way the Google Drive API works AGAIN.

Akeeba Backup can only access the folders and files it has created itself. It is no longer allowed to see any files or folders already in your drive, including the Shared With Me Folders.

To work around that, you will have to go through the custom OAuth2 helper creation instructions on one of your sites. You can then reuse the same custom helper on all of your sites.

The difference is that your custom OAuth2 helper will give the application full access privileges over the entire drive, meaning that you can see the Shared With Me Folders. We cannot do that because, as noted in the documentation, this kind of application will NOT be verified by Google, even for use cases like ours where not giving these privileges make the integration with their service practically useless. But that's Google for you. They play hardball on us small developers “for privacy reasons” while they have no compunction exfiltrating your most intimate data and selling it to the highest bidder. One can only hope that the DOJ anti-trust hearing next spring will rectify this madness.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!