Deployment guide

Migrating Rocket.Chat to Mattermost on a VPS

Deploy on a VPS Cloud →

Tutorial

Migrating Rocket.Chat to Mattermost on a VPS

Self-hosting11 min read14 steps

The Rocket.Chat 8.8.0 release notes published on September 3, 2026 officially announced that LDAP and SAML will become Premium-only features starting from version 9.0. If you run a Community self-hosted instance with enterprise authentication, the migration window is now open. This guide covers backing up your existing Rocket.Chat, installing Mattermost on your VPS, migrating history and users with mmetl, and configuring LDAP in Mattermost Community — which includes it without any plan restriction.

Contents· What changes in Rocket.Chat 9.01/11
  1. 01What changes in Rocket.Chat 9.0
  2. 02Why Mattermost Community is a solid alternative
  3. 03Measured prerequisites
  4. 04Back up Rocket.Chat
  5. 05Install Mattermost on your VPS
  6. 06Migrate history and users with mmetl
  7. 07Configure LDAP in Mattermost Community
  8. 08Cutover plan: keep Rocket.Chat in read-only mode during migration
  9. 09Common troubleshooting
  10. 10Rocket.Chat Community 9.0 vs Mattermost Community
  11. 11Mattermost Community, a stable long-term platform

What changes in Rocket.Chat 9.0

Version 8.8.0, released on September 3, 2026, still runs LDAP and SAML on Community instances — but it introduces explicit warnings in the admin panel: from version 9.0, these two modules will require an ldap-enterprise or saml-enterprise license module. System logs already warn unlicensed workspaces authenticating users through either method.

In practice: if your enterprise directory (Active Directory, OpenLDAP) or identity provider (Okta, Azure AD, Keycloak) is connected to your current Community Rocket.Chat, that connection will stop working when upgrading to 9.0 without a Premium subscription. For teams that built their workflow around this authentication, the migration window is open.

Why Mattermost Community is a solid alternative

  • LDAP and SAML included without a license — Mattermost ships Active Directory and SAML authentication in its open source edition, under MIT license for the server (Apache 2.0 for contributions), with no plan requirement.
  • Native PostgreSQL — Mattermost relies on PostgreSQL, well-documented, easy to back up with pg_dump and more common than MongoDB in self-hosted Docker environments.
  • mmetl, an official migration tool — the mmetl tool from the Mattermost team transforms a Rocket.Chat mongodump into a JSONL import file compatible with mmctl import, including channels, users and messages.
  • Lower memory footprint — Mattermost can start with 2 GB of RAM for teams of fewer than fifty users; Rocket.Chat requires a MongoDB replica set that consumes more at equivalent volume.
  • Official desktop and mobile apps — iOS, Android, macOS and Windows clients point to your own domain from installation.
  • Full message history, no storage quota — no sliding window, no message volume cutoff, everything is stored on your disk or S3 bucket.

Measured prerequisites

Before starting, verify the following.

For the Mattermost server: a VPS with 2 vCPU and 4 GB RAM minimum — 2 GB suffices technically for Mattermost alone, but PostgreSQL runs on the same host during the migration, making 4 GB more comfortable. Plan for 40 GB SSD minimum, more if your Rocket.Chat history contains large file attachments. Docker and Docker Compose must be installed. A dedicated IPv4 and a subdomain chat.yourdomain.com with an A record are required.

For the migration: SSH access to your existing Rocket.Chat server, mongodump tools installed on that server (or via Docker), and mmetl v0.6.0 (released September 11, 2026) installed on your workstation or the new VPS. A valid TLS certificate for the target domain (Let's Encrypt via Certbot or Caddy).

Back up Rocket.Chat

  1. Put Rocket.Chat in read-only mode

    Before any backup, notify your users and put the instance in maintenance mode. In Rocket.Chat administration, go to Administration → General → Maintenance mode and enable read-only mode. This prevents messages from being written after the dump and lost at cutover.

    Alternatively, if you do not have this mode, simply stop the Rocket.Chat container:

    docker compose stop rocketchat
  2. Export the MongoDB database with mongodump

    mmetl expects a directory produced by mongodump, not a compressed file. Run the dump from the host or from inside the MongoDB container:

    # from the host, if mongodump is installed
    mongodump --uri="mongodb://localhost:27017/rocketchat" --out /tmp/rc-dump
    
    # or from the Docker container
    docker exec <mongo-container> mongodump \
      --db rocketchat --out /dump
    docker cp <mongo-container>:/dump /tmp/rc-dump

    Verify that /tmp/rc-dump/rocketchat/ contains .bson and .json files for the rocketchat_message, users, rocketchat_room collections, etc.

  3. Export file attachments (uploads)

    File attachments stored in GridFS or the local filesystem are not part of the MongoDB dump — they must be copied separately.

    If you use local storage (default option):

    docker cp <rocketchat-container>:/app/uploads /tmp/rc-uploads

    If you use an S3-compatible bucket, note the connection parameters — you will reconfigure them in Mattermost. mmetl references file attachments but does not transfer them: you will push them manually or via mmctl import with the --attachments-dir option.

  4. Export users via REST API (optional)

    For an inventory of accounts before migration, the Rocket.Chat API can export the list of active users. This facilitates cross-checking after the Mattermost import:

    curl -H "X-Auth-Token: <token>" \
         -H "X-User-Id: <admin-id>" \
         "https://chat.yourdomain.com/api/v1/users.list?count=200" \
      | python3 -c "import sys,json; [print(u['username'], u.get('emails',[{}])[0].get('address','')) for u in json.load(sys.stdin)['users']]"

    Keep this list: it serves to verify that all accounts are correctly created in Mattermost after bulk import.

Install Mattermost on your VPS

  1. Get the official Docker Compose configuration

    The Mattermost team maintains a docker repository with a ready-to-use Compose configuration:

    git clone https://github.com/mattermost/docker /opt/mattermost
    cd /opt/mattermost
    cp env.example .env

    Open .env and fill in at minimum:

    DOMAIN=chat.yourdomain.com
    MM_SERVICESETTINGS_SITEURL=https://chat.yourdomain.com
    POSTGRES_USER=mmuser
    POSTGRES_PASSWORD=<strong-password>
    POSTGRES_DB=mattermost
  2. Create volumes and start the stack

    Create volume directories before the first startup:

    mkdir -p ./volumes/app/mattermost/{config,data,logs,plugins,client/plugins,bleve-indexes}
    sudo chown -R 2000:2000 ./volumes/app/mattermost

    Start the full stack (Mattermost + PostgreSQL + nginx with integrated Let's Encrypt certificate):

    docker compose -f docker-compose.yml -f docker-compose.nginx.yml up -d

    Wait for the Mattermost container to be healthy before continuing:

    docker compose ps
  3. Create the administrator account

    Open https://chat.yourdomain.com in your browser. On first login, Mattermost prompts for the creation of an admin account. Enter the email, username and password for the initial administrator — this account will be separate from accounts imported from Rocket.Chat.

    Once logged in, go to System Console → Environment → Site URL and verify the URL matches exactly what was declared in .env.

Migrate history and users with mmetl

  1. Install mmetl

    Download the mmetl v0.6.0 binary (released September 11, 2026) from GitHub releases:

    curl -L https://github.com/mattermost/mmetl/releases/download/v0.6.0/mmetl-linux-amd64 \
      -o /usr/local/bin/mmetl
    chmod +x /usr/local/bin/mmetl
    mmetl version

    Breaking change in v0.6.0: the mmetl check subcommand has been removed. Use mmetl transform ... --dry-run to validate the dump before producing the import file.

  2. Transform the Rocket.Chat dump into a Mattermost import file

    Run the transformation pointing to the directory containing the BSON collections exported (the rocketchat subfolder of the dump) and the target Mattermost team name:

    mmetl transform rocketchat \
      --team my-team \
      --dump-dir /tmp/rc-dump/rocketchat \
      --output /tmp/mattermost-import

    mmetl generates an import.jsonl file and a bulk-export-attachments/ directory. To test without generating output:

    mmetl transform rocketchat \
      --team my-team \
      --dump-dir /tmp/rc-dump/rocketchat \
      --dry-run

    Check warnings: messages from private channels without a recognized member are skipped; attachments absent from the uploads directory are referenced but not transferred.

  3. Run the import in Mattermost via mmctl

    Copy the import file into the Mattermost data directory, then run the bulk import:

    # copy into the container
    docker cp /tmp/mattermost-import/import.jsonl \
      <mattermost-container>:/mattermost/data/import.jsonl
    
    # run import from mmctl (inside the container)
    docker exec <mattermost-container> mmctl import bulk \
      /mattermost/data/import.jsonl --bypass-upload

    To track progress, check import jobs in System Console → Bulk Import. Errors are logged line by line — a partial import does not block the rest.

  4. Verify results and known limitations

    After the import, check the following points:
    - Public and private channels should be present in Mattermost with their history.
    - Usernames are imported but passwords are not — each user must reset their password or log in via LDAP if the directory is configured.
    - File attachments require a second pass with --attachments-dir pointing to the directory copied from Rocket.Chat.
    - Discussion threads (nested replies) are flattened if the structure is not recognized.

Configure LDAP in Mattermost Community

  1. Enable LDAP in the System Console

    In System Console → Authentication → AD/LDAP, enable LDAP and fill in the connection parameters:

    LDAP Server: ldap.yourdomain.com (or your domain controller IP)
    Port: 389 (LDAP) or 636 (LDAPS)
    Bind Username: cn=mattermost-svc,ou=serviceaccounts,dc=yourdomain,dc=com
    Bind Password: <service-account-password>
    Base DN: ou=users,dc=yourdomain,dc=com

    Enable LDAP over TLS (LDAPS) or StartTLS if your infrastructure supports it — do not transmit credentials in clear text over an unencrypted network.

  2. Configure attribute mappings

    Mattermost reads LDAP attributes to populate profiles. Common mappings for Active Directory:

    ID Attribute:        objectGUID  (or sAMAccountName if GUID is unavailable)
    Username Attribute:  sAMAccountName
    Email Attribute:     mail
    First Name:          givenName
    Last Name:           sn

    For OpenLDAP, replace sAMAccountName with uid and objectGUID with entryUUID.

    In User Filter, restrict synchronization to members of the desired group:

    (memberOf=cn=mattermost-users,ou=groups,dc=yourdomain,dc=com)
  3. Test the connection and synchronize

    Click AD/LDAP Test at the bottom of the page to validate the connection and bind. If you get LDAP Result Code 49 'Invalid Credentials', check the service account DN and password.

    Trigger a first manual synchronization via AD/LDAP Synchronize Now. Users whose email attribute matches an account already imported via mmetl will be linked automatically — they will then log in with their LDAP credentials without resetting their password.

Cutover plan: keep Rocket.Chat in read-only mode during migration

Do not cut Rocket.Chat before validating the Mattermost import under real conditions. The recommended strategy is to run both instances in parallel for 48 to 72 hours:

1. Enable maintenance / read-only mode on Rocket.Chat as soon as the dump is done.
2. Configure Mattermost on a separate subdomain (chat-new.yourdomain.com) during validation.
3. Invite a pilot group (5 to 10 people) to use Mattermost and report missing channels or messages.
4. Once validated, switch the DNS for chat.yourdomain.com to the new Mattermost VPS.
5. Keep the Rocket.Chat instance in read-only mode for another 30 days so users can retrieve previously shared links.

Cloudflare DNS switches in seconds with a short TTL (60 s) — prepare the modification in advance to avoid working under pressure.

Common troubleshooting

mmetl: unexpected end of JSON input — the directory passed to --dump-dir must be the rocketchat/ subfolder containing .bson files, not the parent dump directory. Check with ls /tmp/rc-dump/rocketchat/*.bson.

Partial import, missing channels — mmetl skips private channels whose owner is not found in the users collection. Check that the affected users are present in the dump with bsondump /tmp/rc-dump/rocketchat/users.bson | grep '<username>'.

LDAP Bind Failure (code 49) — the most common cause is a malformed DN for the service account. Test the connection from the VPS with ldapsearch before configuring Mattermost:

ldapsearch -x -H ldap://ldap.yourdomain.com \
  -D "cn=mattermost-svc,ou=serviceaccounts,dc=yourdomain,dc=com" \
  -W -b "ou=users,dc=yourdomain,dc=com" "(uid=testuser)"

Unstable WebSocket connections — if Mattermost shows frequent disconnections, verify your reverse proxy correctly passes Upgrade and Connection headers. Nginx must include:

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

Missing file attachments — running mmctl import bulk without --attachments-dir creates messages but leaves file attachments in error. Re-run with the bulk-export-attachments/ directory produced by mmetl.

Rocket.Chat Community 9.0 vs Mattermost Community

Scroll the table

CriteriaRocket.Chat Community 9.0Mattermost Community
LDAP / Active DirectoryPremium (from 9.0)Included, no restriction
SAML SSOPremium (from 9.0)Included, no restriction
DatabaseMongoDB (replica set required)PostgreSQL
Minimum RAM4 GB (MongoDB replica set)2 GB (team < 50 users)
LicenseAGPL-3.0MIT (server) / Apache 2.0
Migration toolNative JSON/CSV exportmmetl + mmctl bulk import
Full historyYesYes
Omnichannel (livechat, email)Yes (native)Limited (extensions)

Mattermost Community, a stable long-term platform

Migrating from Rocket.Chat to Mattermost is a structural decision, not a workaround. By moving LDAP and SAML authentication behind a Premium license, Rocket.Chat signals where its business model is heading — which is its right. Mattermost has made the opposite choice by keeping these features in its open source edition, including for organizations without a subscription budget.

On a VPS with PostgreSQL, Mattermost offers a predictable foundation: backups are simple pg_dump operations, updates go through Docker Compose, and the documented REST API allows integrating your infrastructure tools — CI, monitoring, alerts — without plan restrictions. Your team's communication history stays on your disk, exportable and auditable at any time.

See also: Mattermost installation guide on VPS, Mattermost vs Rocket.Chat comparison 2026 and hosting Rocket.Chat on VPS.

Deploy Mattermost on a ServOrbit Cloud VPS

A VPS with root access, dedicated IPv4 and NVMe SSD — the foundation for hosting Mattermost with PostgreSQL and managing your own LDAP authentication.

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.

Message us on WhatsAppopens in a new tab