starlight_help/src/content/docs/import-from-microsoft-teams.mdx
import {Steps, TabItem, Tabs} from "@astrojs/starlight/components";
import FlattenedSteps from "../../components/FlattenedSteps.astro"; import ZulipNote from "../../components/ZulipNote.astro"; import ImportHowUsersWillLogIn from "../include/_ImportHowUsersWillLogIn.mdx"; import ImportIntoASelfHostedServerDescription from "../include/_ImportIntoASelfHostedServerDescription.mdx"; import ImportIntoASelfHostedServerInstructions from "../include/_ImportIntoASelfHostedServerInstructions.mdx"; import ImportIntoAZulipCloudOrganization from "../include/_ImportIntoAZulipCloudOrganization.mdx"; import ImportSelfHostedServerTips from "../include/_ImportSelfHostedServerTips.mdx"; import ImportYourDataIntoZulip from "../include/_ImportYourDataIntoZulip.mdx"; import ImportZulipCloudOrganizationWarning from "../include/_ImportZulipCloudOrganizationWarning.mdx"; import ViewImportedUsers from "../include/_ViewImportedUsers.mdx";
You can import your current workspace into a Zulip organization. It's a great way to preserve your workspace history when you migrate to Zulip, and to make the transition easy for the members of your organization.
The import will include your organization's:
To import your Microsoft Teams data into Zulip, you will need to take the following steps, which are described in more detail below:
<Steps> 1. [Export your Microsoft Teams data](#export-your-microsoft-teams-data). 1. [Authorize a Microsoft Graph API token](#authorize-a-microsoft-graph-api-token). 1. [Import your Microsoft Teams data into Zulip](#import-your-data-into-zulip). 1. [Clean up after the Microsoft Teams export](#clean-up-after-the-microsoft-teams-export). 1. [Get your organization started with Zulip](#get-your-organization-started-with-zulip)! </Steps>When planning to migrate from Microsoft Teams to Zulip, make sure your Microsoft tenant is active and still has access to Microsoft services for at least a couple of months. The process to gain access to the Teams data export tool can take around a month, and Zulip's import tool for Microsoft Teams requires an active Microsoft Entra ID application. Additionally, since the imported users' email addresses will be their Microsoft tenant emails, they will still need access to those accounts to update their Zulip email addresses.
The Teams data export tool supports the export of data for tenants of up to 500 users. If your organization has more than 500 users, you can try the Teams export APIs.
Some organization data is not exported by the Teams data export tool. The Zulip import tool will call several Microsoft Graph APIs to collect the following data:
Hosted contents. Teams content hosted in a chat message, such as images or code snippets.
User roles. The user roles section explains how Microsoft Teams users roles and user types are mapped to Zulip user roles.
To access those APIs, create a Microsoft Entra ID application with the required permissions, and authorize an access token:
<Steps> 1. Log in to the [Microsoft Entra ID](https://entra.microsoft.com/) portal as the **global administrator**. 1. Navigate to the sidebar → **Entra ID** → **App registrations**, and click **New registration**. 1. In the **Register an application** menu, enter the application's name (e.g., "Zulip export"). 1. In the **Supported accounts types** section, select **Accounts in this organizational directory only**. 1. In the **Redirect URI** section, select **Web** as the platform type and enter `"https://chat.zulip.org/"`. 1. In the app's menu, navigate to the **API permissions** menu. 1. Click **Add a permission** and select **Microsoft Graph**. 1. Select **Application permissions** as the permission type. 1. Search and add these permissions: * `ChannelMessage.Read.All`
* `User.Read.All`
* `RoleManagement.Read.Directory`
See the [required token permissions](#required-token-permissions) section for more
details about these tokens and the endpoints that the import tool calls.
your organization button in the API
permissions menu to grant admin consent to all scopes.redirect_uri, tenant_id, client_id, and
client_secret.https://login.microsoftonline.com/<tenant_id>/adminconsent?
client_id=<client_id>
&redirect_uri=<redirect_uri>
redirect_uri with the following parameters:
GET <redirect_uri>?tenant=<tenant_id>&admin_consent=True
curl --location --request POST 'https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<client_id>' \
--data-urlencode 'scope=https://graph.microsoft.com/.default' \
--data-urlencode 'client_secret=<client_secret>' \
--data-urlencode 'grant_type=client_credentials'
{
"token_type": "Bearer",
"expires_in": 3599,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBP..."
}
access_token.
</Steps>
The following Microsoft Graph API endpoints are used by the Zulip import tool:
| Endpoint | Uses | Least-privileged permission |
|---|---|---|
| directory role list member | Used to find users who are global administrators. | User.Read.All |
| list directory role | Used to find the ID for the global administrator role. | RoleManagement.Read.Directory |
| list user | Used to find guest accounts. | User.Read.All |
| get hosted content | Used to download hosted content attachments. | ChannelMessage.Read.All |
<ImportZulipCloudOrganizationWarning />
<FlattenedSteps>
<ImportIntoASelfHostedServerInstructions />
1. To import into an organization hosted on the root domain
(`EXTERNAL_HOST`) of the Zulip installation, run the following
commands, replacing `<token>` with your Microsoft Graph API access token.
<ImportSelfHostedServerTips />
```bash "<token>"
cd /home/zulip/deployments/current
./scripts/stop-server
./manage.py convert_microsoft_teams_data /tmp/TeamsData/ --token <token> --output /tmp/converted_microsoft_teams_data
./manage.py import '' /tmp/converted_microsoft_teams_data
./scripts/start-server
```
Alternatively, to import into a custom subdomain, run:
```bash "<token>" "<subdomain>"
cd /home/zulip/deployments/current
./scripts/stop-server
./manage.py convert_microsoft_teams_data /tmp/TeamsData/ --token <token> --output /tmp/converted_microsoft_teams_data
./manage.py import <subdomain> /tmp/converted_microsoft_teams_data
./scripts/start-server
```
1. Follow [step 4](https://zulip.readthedocs.io/en/stable/production/install.html#step-4-configure-and-use)
of the guide for [installing a new Zulip
server](https://zulip.readthedocs.io/en/stable/production/install.html).
</FlattenedSteps>
Because the import tool is currently in beta, the following data is not imported into Zulip. If importing any of this data is important for your organization, contact [email protected] to see if the import tool can be extended to include it.
@user_a added @user_b to the chatA couple of additional caveats to keep in mind:
Microsoft tenant's user roles are mapped to Zulip's user roles in the following way:
| Microsoft Teams role | Zulip role |
|---|---|
| Global Administrator | Owner |
| Member | Member |
| Guest | Guest |
The Teams export tool does not export organization settings, or full user settings. Configure organization settings as described below, and encourage users to customize their account settings.
Once your organization has been successfully imported in to Zulip, you should delete the Microsoft Entra ID application that you created in order to export your Microsoft Teams data.
Once the import process is completed, you will need to:
<Steps> 1. [Configure the settings for your organization](/help/customize-organization-settings), which are not exported. This includes settings like [email visibility](/help/configure-email-visibility), [message editing permissions](/help/restrict-message-editing-and-deletion), and [how users can join your organization](/help/restrict-account-creation). 1. All users from your previous workspace will have accounts in your new Zulip organization. However, you will need to let users know about their new accounts, and [decide how they will log in](/help/import-from-microsoft-teams#decide-how-users-will-log-in) for the first time. 1. Share the URL for your new Zulip organization, and (recommended) the [Getting started with Zulip guide](/help/getting-started-with-zulip). 1. **Make sure all users [change their Zulip email addresses](/help/change-your-email-address) from their Microsoft tenant emails** to ones they can continue to access, before your organization's Microsoft subscription expires. Zulip's [management tools](https://zulip.readthedocs.io/en/latest/production/management-commands.html) also allow self-hosted server administrators to change user emails directly; Zulip Cloud users can [contact support](mailto:[email protected]) for assistance. 1. Migrate any [integrations](/integrations/). </Steps>