Support

Akeeba Backup for Joomla!

#37039 OneDrive Entreprise : how to upload backups on specific site/group?

Posted in ‘Akeeba Backup for Joomla!’
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
3.10.8
PHP version
8.0
Akeeba Backup version
8.1.3

digitanie

Hi,

 

We want to backups wich be uploaded on dedicated Sharepoint site/group not in personal space/files.

> Like https://<company>.sharepoint.com/sites/Backups (site/group)/Documents/<akeeba-backup.jps>

> Instead of https://<company>-my.sharepoint.com/personal/<user_account>/_layouts/15/<akeeba-backup.jps>

 

Your doc no talking about: https://www.akeeba.com/videos/1212-akeeba-backup/1699-remote-backup-onedrive.html
And official MS API seems say that's is possible: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content

 

How to do?

Thank you.

nicholas
Akeeba Staff
Manager

First of all, you are reading the documentation for a deprecated API. With this API you actually had two separate APIs, one from OneDrive personal and one for OneDrive for Business. For the former you'd create an OAuth2 application on Windows Live which would be common for all users (that's what we did) and they'd only be able to access their OneDrive personal drives — not even their personal drives provided by a school or organization.

The other option was to create an OAuth2 application for a specific Azure tenant. This was absurdly complicated, it had to be done separately for each organisation and would only give access to that organisation's drives (and only according to the privileges delegated to the OAuth2 application). We never implemented that because it would require EITHER creating a separate integration for each and every client of ours (we'd have to charge an upfront  itnegration fee and a yearly maintenance fee on top of the subscription for that to make business sense) OR you'd have to figure out how to create the app in Azure and how to set up the endpoint mediator on your site. Both options require extensive, very expensive support. We can't do that with our current prices, it doesn't make sense to charge everyone extra to subsidise a niche use case and it's impossible to sell a product where a certain feature requires an additional payment that's 10 to 20 times bigger than the product's subscription fee. What made most business sense is refuse to implement this feature and possibly lose a dozen or so clients.

This all became moot in 2019 when Microsoft FINALLY deprecated the kludgy OneDrive API and replaced it with the Microsoft Graph API (https://docs.microsoft.com/en-us/graph/use-the-api), a unified API for all of its services. Its OneDrive integration is here:https://docs.microsoft.com/en-us/graph/onedrive-concept-overview. According to Microsoft, it lets you upload to any of the drives you have upload access, no matter if they are personal or business (organization) drives. The default drive you have access to is your personal drive and that's what we use in our integration. Remember, the original goal was to let people use their Drives regardless of whether they were OneDrive personal (part of their personal account or personal Microsoft Office 365 or-whatever-the-call-it-this-month subscription) or OneDrive for Business (part of their school/organisation's Microsoft whatever-they-call-it-this-month subscription). So, this part works.

What you ask is a bit different. You want to write not to your personal drive provided by your organization but to a different drive which you have write access to as part of your organisation group. Writing to a different drive directly requires some missing plumbing. The only way around that that would work with what you are looking for is possibly doing the same thing we're doing with Google Drive. After you copy your tokens we can access the /me/drives endpoint to get the IDs of the drives you have access to and let you select which one. I can give it a go but since I don't have a business drive and don't have a spare domain to run a new MS subscription I won't be able to test it. I will work on it today. Tomorrow I'll be making releases and you can try that (tentative) feature.

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!

digitanie

Hi,

 

Thank you for your fully response.

I seen release notes of your new version 8.1.4 of Akeeba Backup, with (great) mention "OneDrive for Business: you can now use Drives other than your personal." but no more information from back office interface or from documentation: https://www.akeeba.com/documentation/akeeba-backup-documentation/data-processing-engines.html#proc-onedrive-business

Could you tell us a bit more about how it works, especially the way to path business Drives.

 

Regards

nicholas
Akeeba Staff
Manager

Go to the Configuration page of your backup profile.

Authenticate to OneDrive using your business account.

Click on Save at the top of the page; the page reloads.

Wait for 5–10 seconds.

Look at the OneDrive configuration. There's a Drive drop-down. It is populated by the drives the OneDrive API says that you have access to. Select which one you want. Click on Save & Close again.

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!

digitanie

After that, I get two choices: "Default Drives" and "(OneDrive for Business)". I've tried this two options with and without path in Directory field* and files always sent in my personnal OneDrive files : https://<company>-my.sharepoint.com/personal/<user_account>/_layouts/15/<some_path><akeeba-backup.jps>.

I created dedicated SharePoint site (or group) and i would like that backups path here. My only account is allowed (admin, owner) to access to this location.

 

(*) I've tried many Directory path like:

  • /sites/AkeebaBackups
  • <company>.sharepoint.com/sites/AkeebaBackups
  • <company>.sharepoint.com/sites/Documents/AkeebaBackups
  • /...

 

I don't understand that would to do.

Thanks

nicholas
Akeeba Staff
Manager

If you have two options it means that Akeeba Backup was able to successfully communicated with the OneDrive API and the OneDrive API responded that you only have access to one drive.

The first option in that list is a built-in option which really is “we have selected no drive” and the OneDrive API understands to mean as “use the default drive for the account” during upload — that's how it worked before.

The second etc options are those directly returned by the OneDrive API.

Unfortunately, delegated access (what you are using) does not set up a Drive. It sets up a special folder in your drive. You cannot access these folders using Akeeba Backup. This would require a different connector, one I can neither develop nor test as I don't have a subscription to their most expensive tier which allows this access, nor does it make sense to purchase that for a feature that has only be requested once in 8 years by just the one person, you. 

If it's possible to create a new Drive and share it with your backup then Akeeba Backup will have access to it and you will be able to write to it. Unfortunately that's the full extent of advice I can give as I don't have access to these features.

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: Typically we work Monday to Friday, 9am to 7pm Cyprus timezone (EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets, but we cannot respond to them, outside of our working hours.

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!

Summer vacations: Our support will be closed for replies and new tickets from August 6th to August 21st, 2022 due to summer vacations.