Migrate entire slack channels to discord. Supports threads, pins and files.
GPL-3.0 License
Migrate entire slack channels to discord, with thread, pins and file support.
Create a slack export for your workspace. Slack's official documentation is simple to follow.
Create a Discord bot. Explained below. You'll get a token here to use later.
Copying over users and channel structure.
a. Make all channels on Discord, as they were on Slack. This is useful for cross-referencing later.
b. Invite all users from Slack to Discord, maintaining the names.
c. Add all custom added emojis in Slack to Discord as well. There are tools available to bulk download all emojis in your Slack workspace. Discord allows selecting multiple emojis to upload.
Install dependencies.
pip3 install -r requirements.txt
export S2DTOKEN="YOUR-TOKEN-HERE"
python3 migrate.py
s2d!hi
The bot should respond with
Hello there !
slack_channel_name
, run thiss2d!migrate path/to/extracted/slack/export slack_channel_name
Your slack export would look like this.
Export
- channel_1
- channel_2
...
- channels.json
- users.json
The script uses channels.json
& users.json
for cross-reference.
You can import multiple slack channels into one discord channel.
s2d!migrate path/to/extracted/slack/export channel1 channel 2
The available commands are visible with a help command.
s2d!help
ToDo You can execute a test run by creating a test channel on discord, and using the sample
directory as an example.
$ git clone https://github.com/kaustubhhiware/slack2discord.git
$ cd slack2discord
// run all steps mentioned above.
// On Discord's #test channel
s2d!migrate path/to/slack2discord/sample general
If all looks good, you can run the actual channel-wise migration.
Disclaimer: If you've never created a discord bot before, this will test your patience. It involves a lot of back and forth of tweaking something, checking if it works, the bot not working, you questioning your life decisions, you questioning my life decisions, crying, and then trying again. And that's okay. It took me 3 hours, but you'll be done in 3 minutes. We'll get through this together.
Create a Discord bot on Discord's Developer Portal under the name slack2discord
(or whatever you prefer).
Add an app icon, because this icon would appear when the bot posts all the messages.
On the left side panel, let's head to Bot
section. Hit Add Bot
.
On the Bot page, set an icon and the username again. Turn on the following toggles:
i. Public bot.
ii. Presence intent.
iii. Server members intent.
iv. Message content intent.
Under the Bot permissions
box, select Administrators
permission. This will allow us to send messages, create threads, send messages in threads, add emojis, pin messages, etc.
Below the username, Click Reset Token
. Copy this token, you're going to use this later.
On the left side panel, Head to OAuth2 > URL Generator
. Select bot
scope, and then Administrators
. Copy the URL generated at the bottom.
Head to OAuth2 > General
. Under Default Authorization Link
, choose Custom URL
, and paste the copied URL.
Enter the copied URL into a new browser tab, and invite the bot into your Discord server.
You should see the bot added on Discord, and we're all done with this step.
If the bot doesn't work, go back and check all the things above are as we want. Some of the toggles on 4th step might not be saved. After making all changes, on the Bot page
hit reset token and retry with the new token.
:+1:
. Figure out how to do that.In July 2022, Slack announced changes to the free plan. Instead of retaining the last 10,000 messages; it will now retain only the last 3 months of messages.
While the change is okay (even good) for large communities; for people who use it for threads, reminders and the channel structure - for personal use - this was devastating. For me:
I checked a few repositories that handled the migration, but none were to my liking. I spent 4 hours on one repository with 40 stars, and it didn't work. Fine, I'll write the bot myself.
The GNU GENERAL PUBLIC LICENSE 2007 - Kaustubh Hiware. Please have a look at the LICENSE.md for more details.