Upgrade OpenVidu High Availability: DigitalOcean#
DigitalOcean
In DigitalOcean environments, we recommend upgrading by redeploying the OpenVidu High Availability DigitalOcean stack using the latest version. This approach ensures that all components are updated accurately and consistently, as DigitalOcean terraform files and related configurations may vary between releases. Redeploying guarantees that all necessary changes are properly applied.
However, if you prefer not to redeploy, it is also possible to upgrade OpenVidu High Availability in place. The following steps outline how to perform an in-place upgrade of your OpenVidu High Availability deployment on DigitalOcean:
Upgrading OpenVidu High Availability on DigitalOcean#
- SSH into one of your Master Node servers.
-
Execute the following command in the Master Node:
To upgrade to a specific version instead, replace
latestwith the version number (e.g.3.x.y). -
This will execute an update script that will guide you from the version you have installed to the latest one. The first thing you will see in the output is the following:
Stopping OpenVidu service... Backing up files... - Backing up file '/opt/openvidu/config' to '/opt/openvidu/backups/<DATE>_<VERSION>/config' ... More files ... -------------------- 📦 Backup directory: /opt/openvidu/backups/<DATE>_<VERSION>/ -------------------- -------------------- 🚀 Updating OpenVidu from 3.x.x to 3.y.y -------------------- ? Do you want to update from 3.x.x to 3.y.y? › • Yes No -
Confirm each version upgrade. You can jump straight to the latest release no matter how far behind you are, the updater will automatically apply every intermediate upgrade in sequence.
For each intermediate version, the updater will ask you to confirm the upgrade, display a diff of configuration file changes, ask whether to apply the diff, and ask whether to pull updated Docker images. You must confirm each step.
Warning
The updater will flag any deployment breaking changes if they are present. Pay special attention to these, as they may require you to update firewall rules, open or close specific ports, or perform other manual configuration changes.
Pulling Docker images
When upgrading across multiple intermediate versions, answer
Nowhen the updater asks whether to pull images at each intermediate step. Only answerYesfor the final version.Any missing images will be pulled automatically when you run
systemctl start openvidu. -
Repeat the steps 1 to 4 in all the Master Nodes of your deployment. This is important because the Master Nodes need to be running the same version of OpenVidu.
-
After upgrading all your Master Nodes, you need to delete the Media Nodes to apply the changes. Go to your DigitalOcean web console, open the Droplets tab, select the Media Node instances, and terminate them. The DigitalOcean Function will create new Media Nodes, or the Fixed Autoscale Pool will if you have fixed Media Nodes.
-
Once the Media Nodes are up and running, execute the following command in every Master Node to start OpenVidu High Availability again:
The
journalctlcommand will show you the logs of the OpenVidu services. You can stop the logs by pressingCtrl + C.
Backups and Rollback#
When you finish the upgrade process, you will have a backup of the previous version in the /opt/openvidu/backups directory. The backup only contains the previous configuration files that have changed in the upgrade process.
To roll back to the previous version, you have to copy the files from the backup to the OpenVidu directory on each Master Node. You can do it with the following command:
cp -r /opt/openvidu/backups/<DATE>_<VERSION>/* /opt/openvidu
/usr/local/bin/store_secret.sh save OPENVIDU_VERSION "<VERSION>"
/usr/local/bin/store_secret.sh fullsave
Where <DATE> and <VERSION> are the date and version of the backup you want to restore. For example:
cp -r /opt/openvidu/backups/2025-02-12-09-50-46_3.0.0/* /opt/openvidu
/usr/local/bin/store_secret.sh save OPENVIDU_VERSION "3.0.0"
/usr/local/bin/store_secret.sh fullsave
Notice the store_secret.sh command at the end. This command is necessary to update the OPENVIDU_VERSION secret in DigitalOcean secret.env, which is used by the DigitalOcean deployment to know which version of OpenVidu should be running in Media Nodes. You need to do this in the Master Node only.
Remember to delete the Media Nodes after rolling back to the previous version so the Autoscale Pool can launch new Media Nodes with the restored configuration. You can do this by going to your DigitalOcean web to the Droplets tab, selecting the Media Nodes instances, and terminating them.
Recommendations#
- Always upgrade all nodes in your OpenVidu High Availability deployment. Running mismatched versions across nodes may cause compatibility issues.
- If you encounter any problems during an upgrade, a full redeployment is always the recommended path to a clean installation.
- Keep your Docker and Docker Compose versions up to date.
-
Remove unused images and containers to free up disk space. For example, once the upgrade is complete and OpenVidu is running, you can remove old images with the following command:
This command removes all images that are not currently in use by any container.