Workspace migration tool for Twake Workplace — import data from Slack and Google Workspace into Linagora's open-source collaboration stack.
Enterprises moving to open-source collaboration face a critical barrier: data migration. Years of messages, files, and emails are locked inside proprietary platforms. Without a migration path, teams lose institutional knowledge and adoption stalls.
twake-migrate solves this by providing automated, auditable imports from:
- Slack — channels, messages, threads, and file attachments
- Google Workspace — Gmail, Google Drive, Google Chat, and Hangouts
Data flows into Twake's three core services:
| Source | Target | Protocol |
|---|---|---|
| Slack channels / Google Chat | Twake Chat | Matrix Client-Server API |
| Gmail mbox archives | Twake Mail | JMAP (RFC 8621) via TMail |
| Slack files / Google Drive | Twake Drive | Cozy Files API |
# Clone and install
git clone https://github.com/JacobiusMakes/twake-migrate.git
cd twake-migrate
npm install
# Or install globally
npm install -g .Requires Node.js 18+ (uses native fetch).
# Slack
twake-migrate dry-run slack ./slack-export-2024/
# Google Takeout
twake-migrate dry-run google ./takeout-20240115/twake-migrate slack ./slack-export/ \
--homeserver https://matrix.twake.app \
--token syt_admin_xxxx \
--domain twake.app \
--drive-url https://drive.twake.app \
--drive-token eyJhbG... \
--verbosetwake-migrate google ./takeout/ \
--homeserver https://matrix.twake.app \
--token syt_admin_xxxx \
--domain twake.app \
--jmap-url https://mail.twake.app/jmap \
--jmap-token eyJhbG... \
--drive-url https://drive.twake.app \
--drive-token eyJhbG... \
--verboseImport a Slack workspace export into Twake.
| Option | Description |
|---|---|
--homeserver <url> |
Matrix homeserver URL (required) |
--token <token> |
Matrix admin access token (required) |
--domain <domain> |
Matrix domain for user IDs |
--drive-url <url> |
Cozy instance URL for file uploads |
--drive-token <token> |
Cozy bearer token |
--batch-size <n> |
Messages per batch (default: 100) |
--skip-files |
Skip file attachment uploads |
--skip-archived |
Skip archived channels |
--channel <name> |
Import only a specific channel |
--verbose |
Show detailed progress |
Import Google Takeout data into Twake.
| Option | Description |
|---|---|
--homeserver <url> |
Matrix homeserver URL (required) |
--token <token> |
Matrix admin access token (required) |
--jmap-url <url> |
JMAP session URL for email import |
--jmap-token <token> |
JMAP bearer token |
--drive-url <url> |
Cozy instance URL for file uploads |
--drive-token <token> |
Cozy bearer token |
--skip-mail |
Skip Gmail import |
--skip-drive |
Skip Google Drive import |
--skip-chat |
Skip Google Chat/Hangouts import |
--verbose |
Show detailed progress |
Preview what would be imported without contacting any APIs.
Use Slack's built-in export feature (Workspace Settings > Import/Export Data). Extract the ZIP file and point twake-migrate at the resulting directory.
Expected structure:
slack-export/
channels.json
users.json
general/
2024-01-15.json
2024-01-16.json
engineering/
...
Use Google Takeout to export your data. Select the products you want to migrate (Gmail, Drive, Chat). Extract the ZIP and point twake-migrate at the directory.
Expected structure:
takeout/
Takeout/
Mail/
All mail Including Spam and Trash.mbox
Drive/
My Drive/
...
Google Chat/
Groups/
...
Users/
...
src/
index.js CLI entry point (Commander.js)
importers/
slack.js Parse Slack export format
google.js Parse Google Takeout format
exporters/
matrix.js Matrix Client-Server API client
drive.js Cozy Files API client
jmap.js JMAP email import client
The tool follows a parser/exporter architecture:
- Importers read and parse source platform export formats
- Exporters write data into Twake's service APIs
- The CLI orchestrates the flow with progress reporting
- Parse
channels.jsonto discover channels and metadata - Parse
users.jsonto build Slack username to Matrix user ID mapping - For each channel:
- Create a Matrix room with matching name and topic
- Read daily JSON files in chronological order
- Convert Slack markup (
<@U123>,<#C456|name>) to readable text - Send messages via Matrix API with original sender attribution
- Upload file attachments to Matrix content repository
- Optionally mirror files to Twake Drive
- Discover available data types in the Takeout directory
- Gmail: Parse mbox files, upload RFC 5322 blobs via JMAP Email/import
- Drive: Recursively upload files preserving folder structure via Cozy API
- Chat/Hangouts: Parse conversation JSON, create Matrix rooms, import messages
- Zero runtime dependencies beyond Commander.js for CLI parsing
- Uses Node.js 18+ native
fetchfor all HTTP calls - Messages include
dev.twake.migrate.*metadata fields for traceability - Migrated rooms are tagged with
u.migratedfor easy filtering - Rate limiting between batches prevents overwhelming target servers
- Errors are logged but don't abort the migration (skip-and-continue)
AGPL-3.0 — matching Linagora's open-source licensing.