GithubHelp home page GithubHelp logo

chkp-roniz / teams-migrate Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 3.0 34 KB

Moving to Microsoft Teams from Slack or starting fresh? You've come to the right place.

JavaScript 2.90% C# 97.10%
slack teams migration collaboration channels chats microsoft

teams-migrate's Introduction

Migrate Slack Workspace to Microsoft Teams

based on the great Channel Surf util

Moving to Microsoft Teams from Slack or starting fresh? You've come to the right place. Here's what this tool can do for you:

  • Migrate Slack workspace channels structure in Teams
  • Migrate team and channel members
  • Migrate all messages including:
    • Thread hierarchy
    • File attachments
  • Migrate users

Slack Archive

You can create a Slack Team export on a self-service basis as a Slack Team Owner or Admin at this page https://my.slack.com/services/export. Download the export file and tell Channel Surf its location. We'll scan it and re-create the Slack channel structure in Teams - and give you the option to do more.

Setup a development environment

  • Clone this GitHub repository.
  • Install Visual Studio 2019. Don't have it? Download the free Visual Studio Community Edition
  • Don't want to use Visual Studio? Project was written using .NET Core and runs on Windows, macOS, and Linux. Instead of using Visual Studio, you can simply download the SDK necessary to build and run this application.

Identify a test user account

Azure App registrations

You must register this application in the Azure Active Directory tenant associated with your Office 365 organization.

  • Sign in to your Azure Management Portal at https://portal.azure.com
    • Or, from the Office 365 Admin center select "Azure AD"
  • Within the Azure Portal, select Azure Active Directory -> App registrations -> New application registration
    • Name: TeamsMigrationCli (anything will work - we suggest you keep this value)
    • Application type: Native
    • Redirect URI: https://migrator-cli (anything else will work if you want to change it)
    • NOTE: In earlier versions of this code, we hard-coded this value in Program.cs. It's now been moved to appsettings.json and we've agained defaulted it to https://migrator-cli
    • Click Create
  • Once Azure has created your app, copy your Application Id and give your application access to the required Microsoft Graph API permissions.
    • Click your app's name (i.e. TeamsMigrationCli) from the list of applications

    • Copy the Application Id

    • All settings -> Required permissions

      • Click Add
      • Select an API -> Microsoft Graph -> Select (button)
      • Select permissions:
      API / Permissions name Type Description
      Channel.Create Application Create channels
      Channel.ReadBasic.All Application Read the names and descriptions of all channels
      ChannelMember.ReadWrite.All Application Add and remove members from all channels
      ChannelMessage.Read.All Application Read all channel messages
      ChatMessage.Read.All Application Read all chat messages
      Group.Create Application Create groups
      Group.ReadWrite.All Application Read and write all groups
      GroupMember.ReadWrite.All Delegated Read and write group memberships
      GroupMember.ReadWrite.All Application Read and write all group memberships
      profile Delegated View users' basic profile
      Team.Create Application Create teams
      Team.ReadBasic.All Delegated Read the names and descriptions of teams
      TeamMember.ReadWrite.All Delegated Add and remove members from teams
      TeamMember.ReadWrite.All Application Add and remove members from all teams
      Teamwork.Migrate.All Application Create chat and channel messages with anyone's identity and with any timestamp
      User.Read Delegated Sign in and read user profile
      User.ReadWrite.All Application Read and write all users' full profiles
    • If you plan to run Channel Surf as a non-administrator: applications built using the Graph API permissions above require administrative consent before non-administrative users can sign in - which fortunately, you'll only need to do once.

      • You can immediately provide consent to all users in your organization using the Azure Portal. Click the "Grant permissions" button, which you can reach via your app's "Required permissions" link.
        • Here's the full path to "Grant permissions": Azure Active Directory -> App registrations -> Your app (i.e. ChannelSurfCli) -> All settings -> Required permissions -> Grant permissions
      • Or, whenever you successfully launch ChannelSurfCli, we'll show you a URL that an administrative user can visit to provide consent.
        • Note: if you've configured the re-direct URL to be the same value as we've shown you on this page (i.e. https://channelsurf-cli), you'll be sent to an invalid page after successfully signing in. Don't worry!
  • Take note of your tenant name, which is typically in the form of your-domain.onmicrosoft.com. You'll need to supply this when building or running ChannelSurfCli.

Usage

  • n/name [string] (required) - Team name
  • m/messages [boolean] - Migrate channel messages
  • f/files [boolean] - Migrate channel files
  • e/export [string] (required) - Export file path
  • c/client [string] (required) - Application (client) ID
  • t/tenant [string] (required) - Directory (tenant) ID
  • r/redirect [string] (required) - Redirect URI
  • a/authority [string] - Authentication authority URL. Default 'https://login.microsoftonline.com/{0}'
  • d/domain [string] (required) - Users domain
  • s/secret [string] (required) - Client Secret token
  • r/readonly [boolean] - Readonly mode
  • v/verbose [boolean] - Verbose

For example:

TeamsMigrate.exe -v -e myworkspace.zip -d myworkspace.onmicrosoft.com -c <client id> -t <tenant> -r 'https://migrator-cli'

Questions and comments

We'd love to get your feedback about this sample. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about Microsoft Graph development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [microsoftgraph].

Additional resources

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

teams-migrate's People

Contributors

chkp-roniz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

teams-migrate's Issues

Option to set Channels to Private or Shared

Hi @chkp-roniz

In channels.cs, if I set the membershipType and (!channel.membersipType.Equals to Private or Shared, it attempts to create with the specified membershipType, but then fails and just ends creating the channels as standard.
Is there somewhere else that needs to be updated to be able to achieve creating the migrated channels as private or shared?

Attachment Icon in Teams Chat does not link to actual attachment

Hi Ron,

Thank you so much for this awesome tool!

I'm hoping you can shed some light on an issue we're having with it.
It appears that attachment icons within chats don't correctly link to the related file, however when you access the file via the Files tab, it opens just fine.

The below image shows the attachment appearing just fine in the channel chat
Attachment Icon

When clicking on the attachment icon, it shows the below page. Looking at dev tools, there is a 404 error.
File Missing

The file icon appears as normal in the Files tab
Files Tab

And when you click it, the file opens as expected.
File Not Missing

When comparing the ResourceID (from the DevTools portion of Screenshots two and Four), they are different; I can't see in the repo where this ID is coming from.

Any advice and assistance is greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.