Hello! We currently have a Rocket.Chat running on Ubuntu 20.04 installed via Digital Ocean one-click install. However, we are going to need a different URL for this server soon as we will need to distinguish between two purposes. Since I would actually prefer a snap install over the Digital Ocean one-click install (and Debian over Ubuntu), I was thinking about creating the new server on a separate droplet and migrate the current content/database. What is the smoothest way to do this?
“Carefully”
Lots, of backups, and test, test, test again.
You should move the DB between same Rocket and Mongo versions eg 3.18.1 → 3.18.1
Do NOT try mixing them, particularly the Rocket version. I am not sure what version snaps are but you may need to wait until a matching version is released
You will need to backup the old version, open the backup zip, and rename the DB to ‘parties’ - see elsewhere here about the DB name.
I just completed this myself.
Steps:
- On old server, backup the rocketchat database and TAR it into backup.tar:
mongodump -o ~/backup
tar cvf backup.tar ~/backup
-
Move backup.tar to the new server with snap install of Rocket.chat.
-
Unzip the tar file. You should do it from the root, because the tar includes all of the directories in it, if you do it from your user directory, the /backup folder will not be where you expect it.
tar xvf backup.tar
- Take Rocket.chat offline:
snap stop rocketchat-server.rocketchat-server
- Now, the snap install uses a different database name, ‘parties’. You’ll need to drop that database. Go into the Mongo shell, switch to use that database, and drop it.
mongo
show dbs
use parties
db.dropDatabase()
show dbs
You should see that the first show dbs indicates that parties is present, but the second one shows that it is gone.
- Restore the database, forcing the name to be parties:
mongorestore -d parties ~/backup/
- Restart Rocket.chat server:
snap start rocketchat-server.rocketchat-server
- Confirm server status:
snap services rocketchat-server
You should be good to go!