Bonjour ! Profitez de rabais et prix exceptionnelle d'introduction, contactez-nous sur ce numéro : +1 514 666 4647
Blog, Technology and consulting

How we simplified Rocket.Chat updates (and you can too! with our script)

  • Tekru Technologies
    Tekru TechnologiesThe team
How we simplified Rocket.Chat updates (and you can too! with our script)

Introduction:

At Tekru, we’ve been using Rocket.Chat for our internal communications it’s been a fantastic tool for collaboration. But—like most things in life—keeping it up-to-date can be a bit of a pain. We found ourselves struggling with manual updates, which can sometimes be tricky and time-consuming. So, we rolled up our sleeves and created a simple shell script to automate the process. And because we’re committed to the open-source community, we’re excited to share it with you!

Why regular updates are important (and necessary):

  • Stay secure: Every update is an opportunity to patch vulnerabilities and keep the bad guys out.
  • Boost performance: New versions often come with performance enhancements, helping your Rocket.Chat instance run smoother.
  • Enjoy new features: Let’s face it, we all love shiny new features. Regular updates ensure you’re not missing out!

How we solved our update struggles with a script

We got tired of manually downloading, extracting, and configuring each new version, so we dove into Rocket.Chat’s documentation, pieced things together, and voilà—we created a script that takes care of everything! Whether you’re a developer, a sysadmin, or just someone trying to keep your team’s communication tools running smoothly, this script will save you a lot of headaches.

Discover Our Company

How We Collaborate with You

icon

Thinking Big

We turn your ambitions into concrete goals, putting innovation at the heart of our collaboration.

icon

Starting Small

We begin with pragmatic solutions and then evolve with agility to maximize your success at each step.

icon

Creating Fast

Our responsive team turns ideas into tangible results, accelerating your growth and impact.

icon

Innovating at Scale

We push boundaries to help you seize large-scale opportunities, ensuring visionary collaboration.

Step-by-step guide to updating Rocket.Chat with our script:

1. Always start with a backup (seriously, do it!)

No one likes unpleasant surprises, so before doing any updates, make sure to back up your Rocket.Chat instance.

# Backup MongoDB database
mongodump --db rocketchat --out /path/to/backup/directory

# Backup Rocket.Chat files (optional, but recommended)
tar -czf /path/to/backup/rocketchat-files.tar.gz /path/to/rocketchat
Language:bash

2. Run the script we created

Here’s where the magic happens. We wrote a simple script that automates the entire update process. It’s available on GitHub, so you can download it and customize it as you like.

You can grab the script here on GitHub.

#!/bin/bash

# Define Rocket.Chat installation directory and user
ROCKET_CHAT_DIR="/opt/Rocket.Chat"
ROCKET_CHAT_USER="rocketchat"

# Stop Rocket.Chat service
echo "Stopping Rocket.Chat service..."
sudo systemctl stop rocketchat

# Backup existing Rocket.Chat installation
echo "Backing up current Rocket.Chat installation..."
tar -czf "$ROCKET_CHAT_DIR-backup-$(date +%F).tar.gz" $ROCKET_CHAT_DIR

# Download the latest Rocket.Chat version
echo "Downloading the latest Rocket.Chat version..."
LATEST_VERSION=$(curl -s https://releases.rocket.chat/latest/download | grep -oP 'Rocket.Chat-.+\.tar\.gz')
curl -L https://releases.rocket.chat/latest/download/$LATEST_VERSION -o /tmp/$LATEST_VERSION

# Extract and update Rocket.Chat
echo "Updating Rocket.Chat..."
tar -xzf /tmp/$LATEST_VERSION -C /tmp
sudo cp -r /tmp/bundle/* $ROCKET_CHAT_DIR

# Set correct permissions
echo "Setting permissions..."
sudo chown -R $ROCKET_CHAT_USER:$ROCKET_CHAT_USER $ROCKET_CHAT_DIR

# Start Rocket.Chat service
echo "Starting Rocket.Chat service..."
sudo systemctl start rocketchat

echo "Rocket.Chat has been successfully updated!"
Language:bash

3. Check the Rocket.Chat status

Once the script finishes its job, restart the service and make sure everything’s running smoothly:

sudo systemctl status rocketchat
Language:bash

4. Verify the update

Log into your Rocket.Chat admin panel (Administration > Info) to confirm that your instance is now rocking the latest version.

Wrapping up

At Tekru, we’re always excited to contribute to the open-source community, and this script is our small way of giving back. If you’re running a self-hosted Rocket.Chat instance like us, we hope this makes your life a little easier. Feel free to fork the repository, tweak the script, and share it with others!

You can check out the script and contribute to it on our GitHub repository.
Happy updating!

Disclaimer
This script has been tested on Tekru’s self-hosted Rocket.Chat instance, and it works well in our environment. However, every setup is different. We recommend thoroughly testing it in your staging environment before using it in production. Tekru Technologies assumes no responsibility for any potential issues or data loss resulting from the use of this script. Always remember to make backups before running updates!

Tags:
  • DevOps
  • Open-source
  • RocketChat
;