[HOW TO] Move from Snap to Docker

Hello all,

for all of you who are facing the same challenge to migrate from Snap to Docker, I have summarized the steps.

Check prerequisites:

  • Rocketchat’s Docker container and MongoDB must have the same version as the Snap installation.
  1. Download the docker compose file:
    curl -L https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml -O
  2. Delete the rocketchat service from the compose.yml file.
  3. Starts the compose process with:
    docker-compose up -d
  4. Switch into the Volume dir from the mongodb:
    For me e.g. /opt/RocketChat/mongodb
  5. Create a dump from the snap RocketChat database:
    mongodump -d parties
  6. Now Import the database into the mongodb docker container
    Switch into the container:
    docker container exec -it rocketchat-mongodb-1 bash
    Switch to the database dir and restore the database:
    cd bitnami/mongodb/
    mongorestore -d rocketchat dump/parties/
  7. Replace the compose file and starts the server:
    curl -L https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml -O
    docker-compose up -d

The migration is complete.

So it had worked for me now, maybe someone knows there another trick. :slight_smile:

1 Like

Thank you for the how-to, I’ve just migrated succesfully based on this tutorial.

Since I moved my installation to another server, I created the database backup using sudo snap run rocketchat-server.backupdb. This creates a .tar.gz archive of the dump that needs to be extracted on the target server.

Also, I had to make a couple of adjustments to the docker-compose.yml file (because every setup is different, I guess). But overall, this is the way to go. Just make sure your snap and docker versions of Rocket.Chat are equal.