How to migrate from Microsoft 365 to Nextcloud
Leave Microsoft 365 in waves: Keycloak in front of Entra ID, then OneDrive and SharePoint to Nextcloud, Teams to Mattermost and Jitsi Meet, pages to Outline.
In short
- A Microsoft 365 exit runs in waves: identity first, then files, then chat and meetings, then the wiki, with mail decided on its own and licences reduced as each wave closes.
- Keycloak can broker Entra ID, so people sign in to every new app with their Microsoft account while Exchange and the remaining workloads keep using Entra ID.
- OneDrive and SharePoint copy into Nextcloud with rclone; permissions, links, version history, pages, lists and flows are rebuilt or archived, not transferred.
- Pilae does not operate mail: Exchange Online stays, on a mail-only plan if that suits, or mail moves to a provider you choose as a separate project.
On this page (10)
Moving from Microsoft 365 to Nextcloud and the open-source apps around it is several migrations run in waves, not one export. Identity goes first, so that every new app signs people in the same way. Files follow, then chat and meetings, then the wiki. Mail is a decision of its own, because Pilae does not run a mail server. This guide gives the order, what each wave involves and what does not come across, and points to the detailed guides for the waves that have one.
Why teams move from Microsoft 365
Three reasons come up most often.
- Where the data sits. Microsoft 365 keeps files, chats and identities in Microsoft datacentres, with an EU Data Boundary and in-country data residency for eligible customers. The open-source stack runs on your premises or in a region you choose, so the answer to “where are our documents” is a building you can name.
- One tenant for everything. Identity, mail, files and chat usually sit in one tenant under one contract, and licence prices and terms change on Microsoft’s schedule. Moving the workloads where control matters most leaves less of the organisation inside that one contract.
- One workload at a time. Nothing forces a single switch. Each app works next to Microsoft 365 during the transition, and the move can stop at any wave.
What you give up is breadth and integration: Office on every device with co-authoring across organisations, Copilot, Teams telephony, webinars and town halls, Loop, and the links between Outlook, Teams and Office. Two pieces of the open-source stack carry licences of their own: Collabora’s supported build is sold per user, and single sign-on in Mattermost needs a paid Mattermost plan. And the stack has to be operated, which is the part Pilae takes on.
The waves, in order
- Identity: Keycloak goes in front of every new app, brokering Entra ID.
- Files: OneDrive and SharePoint move to Nextcloud, with documents edited in Collabora Online.
- Chat and meetings: Teams channels move to Mattermost, and meetings to Jitsi Meet.
- Wiki: Pages and notes worth keeping move to Outline.
- Licences: Each wave’s licences come off at the renewal after it closes.
| Microsoft 365 | In the open-source stack |
|---|---|
| Entra ID sign-in | Keycloak, brokering Entra ID during the move |
| OneDrive | Nextcloud personal files |
| SharePoint document libraries | Nextcloud team folders |
| Word, Excel and PowerPoint online | Collabora Online, inside Nextcloud |
| Teams chat and channels | Mattermost, or Element |
| Teams meetings | Jitsi Meet |
| SharePoint pages, OneNote, Loop | Outline |
| Power Automate | n8n |
| Exchange Online and Outlook | Stays at Microsoft, or moves to a mail provider you choose |
Step 1: map the tenant
The inventory decides the order of the waves and how long Entra ID has to stay.
- Usage per workload. In the Microsoft 365 admin center, Reports, Usage holds the Active users, OneDrive usage, SharePoint site usage, Teams team activity and Mailbox usage reports, each exportable. Names and site URLs stay hidden until a global administrator clears “Conceal user, group, and site names in all reports” under Settings, Org settings, Services, Reports.
- Applications that sign in through Entra ID. The enterprise applications list in the Microsoft Entra admin center shows every app that uses Microsoft sign-in today. Each one moves to Keycloak, stays on Entra ID while it lasts, or is retired.
- Automations and the smaller apps. In the Power Platform admin center, Manage, Inventory lists every cloud flow and Power App with who created it and the connectors it uses. The flows still running are rebuilt in n8n. Forms, Planner and Bookings have no automatic counterpart: each gets a decision, a replacement from the app catalogue or a reason to keep it.
- The renewal date. On a Microsoft Customer Agreement, licences can only be removed within seven days of buying or renewing a subscription; where you bought through a partner, ask them for their terms. Plan each wave to close before a renewal.
- Mail. Decide early whether it stays in Exchange Online or moves (step 6), because that decides how long Entra ID stays.
Step 2: put identity in place first
Every app in the new stack signs in through Keycloak, and Keycloak decides where the password is checked. That separation is what lets identity change later without touching the apps.
Two ways to put Keycloak in front of the new apps
Keycloak brokers Entra ID
People sign in at Microsoft, with the account and multi-factor authentication they already have. Keycloak creates its own user at the first sign-in and takes groups from the token. This suits a tenant with no Active Directory behind it.
Keycloak reads your Active Directory
Where Active Directory is synchronised to Entra ID, Keycloak binds to it read-only over LDAP and checks passwords there. Entra ID keeps serving the Microsoft workloads from the same directory.
For a cloud-only tenant, brokering is the usual start.
- Register Keycloak in Entra ID as an application, and add Entra ID to Keycloak as an OpenID Connect identity provider.
- Bring the groups. By default Entra ID puts group object IDs in the token, not names; display names only come for cloud-only groups assigned to the application. Above 200 groups in a token, Entra ID sends none. Assign to the Keycloak application the groups the new apps need, and map them to Keycloak groups with the Advanced Claim to Group mapper.
- Send people straight to Microsoft. Set Entra ID as the default identity provider in Keycloak’s browser flow, so the sign-in page is the one people know.
- Connect each app to Keycloak, never directly to Entra ID: Nextcloud, Mattermost, Outline and the Jitsi Meet hosts over OpenID Connect. When Entra ID goes, only Keycloak’s identity provider changes.
Keycloak never sees a password while it brokers Entra ID. When Entra ID is eventually switched off, every account needs a password somewhere Keycloak can check it: your Active Directory, or set once by each person in Keycloak. Plan that day together with mail, because every Microsoft 365 account, including the ones that hold mailboxes, lives in Entra ID for as long as anything stays at Microsoft. Our identity services set this up and write the runbook for joiners, movers and leavers.
Step 3: move OneDrive and SharePoint into Nextcloud
This is the largest wave by volume, and the SharePoint to Nextcloud guide covers it in detail: the site inventory, the permission map, the rclone copy and the cutover site by site. Microsoft 365 adds four things to it.
- One OneDrive per person. OneDrives do not appear among the active sites in the SharePoint admin center; the OneDrive usage report lists them. An app registration with read-only application permissions, granted by an administrator, lets rclone read each OneDrive by its drive ID, which Microsoft Graph returns for each user, without anyone’s password; the rclone OneDrive notes say which app sign-in methods Microsoft currently accepts. rclone writes each OneDrive into a staging folder of a Nextcloud migration account, pass after pass. After the final pass,
occ files:transfer-ownershipwith--pathhands each folder to its owner. The owner’s account must exist by then, and Nextcloud creates it at the first sign-in, so a short sign-in round comes first. - Teams files are SharePoint files. A team’s channel files sit in its SharePoint site, one folder per standard channel, and each private or shared channel has a site of its own. Files sent in a chat sit in the sender’s OneDrive, in a Microsoft Teams Chat Files folder. They come across with the OneDrive and SharePoint copies; the sharing around them does not.
- Folders redirected to OneDrive. Where Known Folder Move sends Desktop, Documents and Pictures to OneDrive, those folders are part of each OneDrive copy. On the PCs, turning the backup off asks whether the files stay only in OneDrive or only on the PC, so plan that answer device by device, through the policies that set it up, before the OneDrive client goes.
- Documents and Loop. Collabora Online opens Word, Excel and PowerPoint files as they are, so there is no conversion. Round-trip a sample of your heaviest files first, install the fonts your documents use, and set Nextcloud to create new files as .docx, .xlsx and .pptx. Loop is different: Loop components are .loop files in OneDrive or SharePoint, and Loop workspaces live in SharePoint Embedded containers, outside the sites and OneDrives a library copy reads. Copy what matters into Outline or an ordinary document before the wave closes.
Step 4: move chat to Mattermost and meetings to Jitsi Meet
The Teams to Mattermost guide covers this wave step by step. In outline:
- Rebuild the structure, decide on the history. Mattermost’s migration documentation covers Slack and other chat tools, not Teams. Teams and channels are created in Mattermost from the inventory of teams and channels, and the history stays in Microsoft 365 under your retention policy, or is exported with Microsoft tools and kept as an archive. Bots and connectors are rebuilt as webhooks, slash commands or n8n flows.
- Sign-on through Keycloak. In Mattermost, sign-on with the full message history is part of the paid plans, so the licence question is answered before the wave starts. Where messages must be end-to-end encrypted, or shared with partner organisations on their own servers, Element on Matrix is the alternative.
- Meetings in Jitsi Meet. Hosts sign in through Keycloak and guests join from a link in the browser. Owners re-send each recurring Teams meeting with a standing Jitsi Meet room address. There is no phone system and no webinar or town hall format, so organisations that rely on them keep a service for those.
- Switch team by team. Desktop and mobile apps go out first, and each team stops posting in Teams on an agreed day. Archiving the team in the Teams admin center stops all activity while keeping its channels, files and chats readable, and can make its SharePoint site read-only for members.
Step 5: move pages and notes to Outline
Outline takes the pages people read: policies, procedures and team documentation, in collections per team with groups from Keycloak. Outline has no passwords of its own; everyone signs in through Keycloak.
- SharePoint pages. Microsoft Graph returns the text of each modern page as HTML, and Outline takes HTML, Word and Markdown files. Step 6 of the SharePoint guide covers the detail.
- OneNote notebooks. rclone leaves them out of a copy by default. Their pages move by hand, or the notebook is kept as an archive.
- Licence. Outline is source-available under the Business Source License 1.1. Where the wiki has to be open source, BookStack is published under the MIT licence.
Step 6: decide what happens to mail
Pilae does not operate mail, so where it goes is your choice, and the move runs with the mail provider you pick.
- Keep Exchange Online. People who no longer need the rest of Microsoft 365 move to a mail-only plan such as Exchange Online (Plan 1). Entra ID stays as the directory behind it, and Keycloak keeps brokering it. Calendars stay with the mail, where Outlook, meeting invitations and room mailboxes already work.
- Move to a provider you choose. It is a project of its own, with the same freeze-and-switch pattern as the other waves, on its own date. IMAP carries mail only: calendars and contacts move with the provider’s tools, or into Nextcloud as ICS and vCard files, with phones and desktop clients connecting over CalDAV and CardDAV. Once the last mailbox has moved, Entra ID can go.
Either way, Nextcloud Mail can be the web client beside people’s files, including for hosted Microsoft Outlook accounts, which it reaches through Microsoft’s own sign-in.
Step 7: close each wave and reduce licences
- Read-only first. Each wave ends with the old side read-only for an agreed period: SharePoint sites locked with
Set-SPOSite -LockState ReadOnly, teams archived, OneDrives left in place. - Unassign, then remove. Microsoft will not reduce a subscription while every licence is assigned, so licences are first unassigned from the people a wave has moved, then removed at the renewal date.
- Keep what you are obliged to keep. Before an account loses its licence, check what your retention rules require from its mailbox and OneDrive, and export or hold it first.
- Close Entra ID last. It goes only when mail and every remaining application have left it.
Running the stack in production
Nextcloud, Keycloak, Mattermost and Outline each keep their data in their own PostgreSQL database, the three that hold files keep them in object storage, and Keycloak’s whole configuration sits in a realm export kept in your repository. Pilae runs them as one sovereign workplace, on your premises or on dedicated machines in Pilae Cloud, answering only on your private network, with daily encrypted backups stored offsite and, on Enterprise, a restore test every month recorded in the console. The Pilae Agent plans each upgrade, waits for your approval and applies it in your window. For a workload-by-workload comparison first, see the Microsoft 365 alternative page.
Let Pilae run the move
Pilae runs Microsoft 365 migrations at a fixed price, wave by wave: the tenant inventory, Keycloak and sign-on, the OneDrive and SharePoint copy, Teams to Mattermost and Jitsi Meet, pages to Outline, and a cutover for each wave on its own date. Then we operate the stack under a contract that, from the Business plan, includes a monthly availability commitment with service credits. See migration services for what the fixed price covers, or tell us which workloads you want to move and we will scope it.
Questions
Does Pilae replace Exchange and Outlook?
Do we have to leave Entra ID?
Can we keep using Word and Excel?
What happens to Teams chat history?
Is Nextcloud open source, and the rest of the stack?
How long does a Microsoft 365 migration take?
Let us run the move for you
An inventory, a parallel run and a cutover plan, at a fixed price. Then we operate the app.
- Go deeperSaaS migrationA fixed-scope migration off Google Workspace, Microsoft 365, Zapier, Airtable and ChatGPT to open-source apps, with a parallel run and a cutover plan.
- CheckManaged operationsPatching, daily encrypted backups, monitoring and incident response for your open-source apps, under an SLA with an availability commitment of up to 99.9%.
