Skip to content

Digiyang/discord-migrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  ____  _                       _   __  __ _                 _
 |  _ \(_)___  ___ ___  _ __ __| | |  \/  (_) __ _ _ __ __ _| |_ ___  _ __
 | | | | / __|/ __/ _ \| '__/ _` | | |\/| | |/ _` | '__/ _` | __/ _ \| '__|
 | |_| | \__ \ (_| (_) | | | (_| | | |  | | | (_| | | | (_| | || (_) | |
 |____/|_|___/\___\___/|_|  \__,_| |_|  |_|_|\__, |_|  \__,_|\__\___/|_|
                                              |___/

Issues License Python


Following Discord's age-verification changes, some communities are exploring alternative platforms. Migrating manually is tedious — you have to recreate every role, category, and channel by hand. This tool automates that: it reads your Discord server structure via the Discord API and recreates it on a target platform with a single command.

The adapter architecture keeps the core migration logic platform-agnostic, so adding support for a new destination is a matter of implementing one file.


What is migrated

Item Details
Server name & icon Applied to the destination server
Roles Name, colour, and permission mapping
Categories Recreated and linked to their channels
Text channels Name and topic
Voice channels Name

What is NOT migrated

Item Reason
Message history Discord ToS + user privacy
Members Cannot force users to join another platform
Bot integrations Platform-specific, need manual setup
Fine-grained channel permissions No 1:1 mapping across platforms
Custom emojis API limitations

Installation

curl -sSL https://raw.githubusercontent.com/Digiyang/discord-migrator/main/install.sh | bash

This will:

  • Clone the repo to ~/.local/share/discord-migrator
  • Create a Python virtual environment and install dependencies
  • Add a discord-migrator launcher to ~/.local/bin

Running the command again updates the tool to the latest version.

Requirements: Python 3.10+, git

PATH: If ~/.local/bin is not in your PATH, the installer will print the line to add to your ~/.bashrc or ~/.zshrc.


Configuration

To avoid entering credentials on every run, create a config.json file at the project root (it is gitignored and will never be committed):

{
  "discord": {
    "token": "your-discord-bot-token",
    "guild_id": "your-server-id"
  },
  "stoat": {
    "token": "your-stoat-bot-token",
    "server_id": "your-stoat-server-id"
  }
}

Any field present in the file is used silently. Missing fields fall back to an interactive prompt at runtime.


Usage

discord-migrator

You will be prompted to choose a target platform, then confirm or enter credentials.


Platform Setup

Stoat

  1. Create a bot at https://stoat.chat/settings/bots and copy the Bot Token
  2. Create your destination server on stoat.chat and invite the bot to it
  3. Go to Server Settings → Roles and create a role (e.g. bot) with at minimum:
    • Manage Server
    • Manage Channels
    • Manage Roles
    • Manage Permissions
  4. Go to Server Settings → Members, find your bot, and assign it that role
  5. Find your Server ID: open the server in the Stoat web app — the URL looks like https://stoat.chat/server/SERVER_ID/... — copy that value

Discord (source)

  1. Go to https://discord.com/developers/applicationsNew ApplicationBot
  2. Copy the Bot Token
  3. Enable View Channels permission and invite the bot to your server
  4. Find your Server ID: in Discord settings go to Advanced, enable Developer Mode, then right-click your server icon and select Copy Server ID

Project Structure

discord-migrator/
├── src/
│   ├── main.py                       ← CLI entry point
│   ├── models.py                     ← platform-neutral ServerSnapshot dataclasses
│   ├── discord_reader.py             ← reads Discord → ServerSnapshot
│   ├── migrator.py                   ← platform-agnostic migration engine
│   └── adapters/
│       ├── base.py                   ← abstract adapter interface
│       ├── stoat.py                  ← Stoat adapter
│       └── permissions/
│           └── stoat.py              ← Discord → Stoat permission mapping
├── install.sh
├── requirements.txt
└── README.md

Adding a new platform

  1. Copy adapters/guilded.py as a starting point
  2. Implement create_server, create_role, create_category, create_channel
  3. If the platform has its own permission system, add a mapping file under adapters/permissions/myplatform.py
  4. Register it in main.py:
    from adapters.myplatform import MyAdapter
    ADAPTERS["3"]       = MyAdapter
    ADAPTER_LABELS["3"] = "My Platform (myplatform.com)"

The migrator engine handles the rest automatically.


Contributing

Contributions are welcome — especially new platform adapters.

  • Bug reports & feature requests: open an issue on GitHub
  • Pull requests: fork the repo, make your changes on a feature branch, and open a PR against main
  • Keep adapters self-contained — all platform-specific logic stays inside its adapter file
  • If adding a platform with a permission system, add a mapping file under adapters/permissions/

License

MIT

About

Migrate your Discord server structure (roles, categories, channels) to alternative platforms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors