Skip to content

Migrate channel history (messages and attachments) from Slack to Microsoft Teams

License

Notifications You must be signed in to change notification settings

IsakViste/SlackToTeamsMigration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlackToTeamsMigration

Prerequisites

To run the completed project in this folder, you need the following:

  • The .NET SDK installed on your development machine.

  • A Microsoft work or school account.

If you don't have a Microsoft account, you can sign up for the Microsoft 365 Developer Program to get a free Microsoft 365 subscription.

Register Application

  1. Open a browser and navigate to the Azure Active Directory admin center and login using a personal account (aka: Microsoft Account) or Work or School Account.

  2. [CLICK ME] Select Azure Active Directory in the left-hand navigation, then select App registrations under Manage.
  3. Register a new application to the Azure Active Directory

    1. [CLICK ME] Select New registration.
    2. Enter a name for your application, for example, STMigration.

  4. Set Supported account types as desired. The options are:

    Option Who can sign in?
    Accounts in this organizational directory only Only users in your Microsoft 365 organization
    Accounts in any organizational directory Users in any Microsoft 365 organization (work or school accounts)
    Accounts in any organizational directory ... and personal Microsoft accounts Users in any Microsoft 365 organization (work or school accounts) and personal Microsoft accounts
  5. Leave Redirect URI empty.

  6. Select Register.

  7. [CLICK ME] Get the Client and Tenant ID on the application's Overview page
    1. Copy the value of the Application (client) ID and save it, you will need it later.

    2. Also copy the Directory (tenant) ID and save it.

  8. [CLICK ME] Enable public client flows
    1. Select Authentication under Manage.

    2. Locate the Advanced settings section and change the Allow public client flows toggle to Yes, then choose Save.

Configure AAD Application

Note: This section requires a work/school account with the Global administrator role.

  1. Select API permissions under Manage.

  2. Remove the default User.Read permission under Configured permissions by selecting the ellipses (...) in its row and selecting Remove permission.

  3. [CLICK ME] Select Add a permission, then Microsoft Graph
    1. Select Application permissions.

    2. [CLICK ME] Select Teamwork.Migrate.All
    3. Select TeamMember.ReadWrite.All

    4. Select ChannelSettings.ReadWrite.All

    5. then select Add permissions.

  4. [CLICK ME] Select Grant admin consent for..., then select Yes to provide admin consent for the selected permission.
  5. Select Certificates and secrets under Manage, then select New client secret.

    1. [CLICK ME] Enter a description, choose a duration, and select Add.
    2. [CLICK ME] Copy the secret from the Value column, you will need it soon.
  6. Go to the online Graph Explorer

    1. [CLICK ME] Run the default command: GET my profile
      https://graph.microsoft.com/v1.0/me
    2. [CLICK ME] Copy the team user id and save it, you will need it in the next step!

Configure App Settings

Open appsettings.json and update the values according to the following table.

Setting Value
Tenant The tenant ID of your organization
ClientId The client ID of your app registration
ClientSecret The value of the client secret
OwnerUserId The user ID of your team account

Build and Run

In your command-line interface (CLI), navigate to the project directory and run the following commands.

dotnet restore
dotnet build
dotnet run

About

Migrate channel history (messages and attachments) from Slack to Microsoft Teams

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages