Skip to content

Prepare Rocket.Chat for a New Semester

clonm edited this page Aug 13, 2020 · 8 revisions

Step 0: Email people to let them to know that they should download their data (if they want to)

This operation, should it fail, can delete all data for the previous semester. Hopefully people are using Rocket.Chat, and if they are they might have attachment to the messages they sent. They will be rightfully angry if you delete this without letting them know it will be gone.

Step 1: Back-up the database

Hopefully this will automatically happen at some point. But you probably want to do a manual backup right before you start deleting data. To do this:

Log into the mongo container

docker exec --user root -ti mongo /bin/bash --login

Create the backup

mongodump --host localhost --db rocketchat

Step 2: Delete all messages and users in database

In rocketchat web client

Go to Administration->Rooms and delete each room individually (don't do from database or you get weird phantom room errors)

Log into the mongo shell in the mongo container

mongo

Switch to rocketchat db

use rocketchat

Delete users (that aren't admins)

db.users.remove({roles: {$ne: "admin"}}) (Don't exit shell yet)

Step 3: Make all the new users

Import people from csv (made from user email list)

Use the house list spreadsheet to generate usernames and .csv files.

On your local machine:

  1. create a new folder for the root of the zip file to upload, e.g.
mkdir rc_import
cd rc_import
  1. create an empty folder inside the main folder for each channel to be created. The list of channels is in the google sheet under the rocketchat tab.
  2. save users.csv and channels.csv according to this format from the google sheet columns highlighted in yellow.
  3. zip them together with
zip your-folder-name *
  1. use the import csv tool in the rocketchat admin panel to import. Be sure to set import type to csv.

Make users active

db.users.updateMany({active: false}, {$set: {active: true}})

Step 4: Update Zapier

  1. In Administration under Users, rename rocket.cat to clobot
  2. Log into Zapier and update any broken Zaps.

Step 5: Promote Rocket.Chat

Help people install it, and push it at the first few councils and orientations.