← Back to all versions
Prepare for upgrading ThingsBoard
Stop ThingsBoard
Check if ThingsBoard and database services are running. Initially ThingsBoard, check status to ensure it is stopped and then databases.
sudo systemctl stop thingsboard
sudo systemctl status thingsboard
Backup Database
Make a backup of the database before upgrading.
PostgreSQL
Check PostgreSQL status. It is unnecessary to stop PostgreSQL for the backup.
sudo systemctl status postgresql
Make sure you have enough space to place a backup of the database
Check database size:
sudo -u postgres psql -c " SELECT pg_size_pretty( pg_database_size('thingsboard') ); "
Check free space:
If there is enough free space — make a backup:
sudo -Hiu postgres pg_dump thingsboard > thingsboard.sql.bak
Check backup file being created.
Cassandra
Check Cassandra status. It is necessary to stop Cassandra for the backup.
sudo systemctl status cassandra
Flush all memtables from the node to SSTables on disk:
Stop Cassandra:
sudo systemctl stop cassandra
Check the status again to ensure it is stopped:
sudo systemctl status cassandra
Make sure you have enough space to place a backup of the database
Check database size:
du -h /var/lib/cassandra/ | tail -1
Check free space:
Make a backup of Cassandra database:
sudo tar -cvf backup/cassandra.tar /var/lib/cassandra
Check archive being created.
Start Database
Cassandra:
sudo systemctl start cassandra
PostgreSQL: Do nothing, PostgreSQL is already running.
Upgrading ThingsBoard PE to 4.3.1.5 (latest 4.3.1 patch)
Important note before upgrading to ThingsBoard 4.3.1
Starting with version 4.3.1, the platform uses Angular 20 (upgraded from Angular 18). The core platform remains fully backward compatible and no upgrade scripts are required. However, custom UI code (widgets or custom CSS) that relies on internal component structure or CSS variable names may break. This can affect up to ~1% of users with heavy customizations. We recommend testing custom UI in a staging environment before upgrading.
Alarm data migration may extend your upgrade
Starting with 4.3.1.4, ThingsBoard migrates all existing alarms to a new storage format. Alarm data is not lost.
Migration time depends on the number of alarms.
From 4.2.x: the migration runs inside the upgrade script. Don't interrupt it. Plan a longer
maintenance window, and do a trial run on a copy of your production database first.
From 4.3.0 – 4.3.1.3: the migration runs in the background after startup, and older alarms may
not appear in the UI or API until it finishes. The Applied LTS migration 4.3.1.4 log message marks
completion. With multiple tb-nodes, don't run old and new versions side by side: old tb-nodes keep creating alarms
in the old format, and some of them may never appear.
Already on 4.3.1.4 or later: no action needed.
Compatibility check before upgrading
If you are using Edge PE or Trendz Analytics together with ThingsBoard, verify that your target ThingsBoard version is compatible with the currently installed versions of these components. Upgrade them if required to ensure compatibility.
ThingsBoard PE package download
wget https://dist.thingsboard.io/thingsboard-4.3.1.5pe.deb
ThingsBoard PE service upgrade
Stop ThingsBoard service if it is running.
sudo service thingsboard stop
sudo dpkg -i thingsboard-4.3.1.5pe.deb
Note
At the dpkg configuration-file prompt ([Y/I/N/O/D/Z]) there is no "merge" option.
The recommended approach is to use the new configuration file as the base and carry your custom values over from your previous one.
Press Y to install the package maintainer's version (your previous file is kept as .dpkg-old), then copy your custom values from the .dpkg-old file into the new one before starting the service.
Caution
If you are upgrading from 4.2.1.x, you must run the script below. However, if you are upgrading from version 4.3.x, DO NOT run the upgrade script; proceed directly to starting the service.
sudo /usr/share/thingsboard/bin/install/upgrade.sh
Start the service
sudo service thingsboard start
Upgrading ThingsBoard PE to 4.3.0.1 (latest 4.3.0 patch)
Compatibility check before upgrading
If you are using Edge PE or Trendz Analytics together with ThingsBoard, verify that your target ThingsBoard version is compatible with the currently installed versions of these components. Upgrade them if required to ensure compatibility.
ThingsBoard PE package download
wget https://dist.thingsboard.io/thingsboard-4.3.0.1pe.deb
ThingsBoard PE service upgrade
Stop ThingsBoard service if it is running.
sudo service thingsboard stop
sudo dpkg -i thingsboard-4.3.0.1pe.deb
Note
At the dpkg configuration-file prompt ([Y/I/N/O/D/Z]) there is no "merge" option.
The recommended approach is to use the new configuration file as the base and carry your custom values over from your previous one.
Press Y to install the package maintainer's version (your previous file is kept as .dpkg-old), then copy your custom values from the .dpkg-old file into the new one before starting the service.
Caution
If you are upgrading from 4.2.1.x, you must run the script below. However, if you are upgrading from version 4.3.0.x, DO NOT run the upgrade script; proceed directly to starting the service.
sudo /usr/share/thingsboard/bin/install/upgrade.sh
Start the service
sudo service thingsboard start