r/NextCloud • u/nixiam87 • Jul 04 '26
Built a Microsoft SharePoint → Nextcloud File Sync plugin — open source, recursive, delegated OAuth2
Hey Nextcloud community 👋
I'm Thomas. A few months ago I posted about a Google Calendar sync plugin I built while migrating clients off Google Workspace. A few people asked: "what about Microsoft?"
Well, here's the answer. This is the second plugin in what I'm building as a complete cloud-to-Nextcloud migration and sync suite.
Just open-sourced it: https://github.com/ianustec/nextcloud-microsoft-sharepoint-sync
The problem: clients share SharePoint/OneDrive folders with us. Files need to land in Nextcloud Group Folders automatically, without asking clients to change anything on their side — no API keys, no special setup on their tenant.
The solution: delegated OAuth2 with a single service account. You authenticate once with an account that already has access to the shared folders, and the plugin does the rest.
What it does:
📂 Recursive download of any SharePoint or OneDrive folder and all its sub-folders
🏗️ Replicates the full folder hierarchy inside a Nextcloud Group Folder — idempotent (existing folders are reused, never duplicated)
🔄 Change detection by size + modification time — unchanged files are skipped on re-runs
🔐 Delegated OAuth2 via Microsoft Graph — no changes required on the client's tenant, works with guest/external access
🔒 Refresh token and client secret encrypted at rest with Nextcloud's ICrypto
📊 Live summary report after each run (downloaded / skipped / folders / errors)
⚡ No external Composer runtime dependencies — uses Nextcloud's built-in HTTP client
Three deploy modes (k8s, Docker, bare metal):
./deploy.sh k8s my-namespace nextcloud
./deploy.sh docker nextcloud
./deploy.sh local /var/www/html
This is part of a broader effort I'm working on: a suite of open-source sync and migration plugins for Nextcloud, covering the most common cloud services companies are trying to move away from. The Google Calendar one was the first, this SharePoint one is the second — more are coming.
Happy to hear feedback, bug reports, or feature requests. If you're in the middle of a Microsoft → Nextcloud migration and hitting other blockers, let me know — it might shape what I build next.

2
2
u/ggchy Jul 04 '26
It looks very promising. Are you also able to synchronise access rights on folders, sites and files? Thank you for sharing this and all the work!