← 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 to 4.4.1
Compatibility check before upgrading
If you are using ThingsBoard Edge 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.
Important note before upgrading to ThingsBoard 4.4
ThingsBoard backend was migrated to Java 25 . Install JDK 25 and make it the system's default Java version before upgrading.
Please refer to Step 1 of the corresponding installation guide for detailed instructions: Ubuntu
TBEL date formatting changes
ThingsBoard 4.4 runs on Java 25, whose updated Unicode CLDR data changes the locale-formatted strings produced by TbDate methods: toLocaleString(), toLocaleDateString(), toLocaleTimeString(), toString(), toDateString(), toTimeString() and toUTCString(). Scripts that string-match or split formatted dates may behave differently after the upgrade. toISOString(), toJSON(), getTime() and the numeric getters are unaffected.
See Date formatting changes in ThingsBoard 4.4+ for examples and recommendations.
ThingsBoard package download
wget https://github.com/thingsboard/thingsboard/releases/download/v4.4.1/thingsboard-4.4.1.deb
ThingsBoard service upgrade
Stop ThingsBoard service if it is running.
sudo service thingsboard stop
sudo dpkg -i thingsboard-4.4.1.deb
Configuration files
dpkg asks about a configuration file ([Y/I/N/O/D/Z]) only if you changed that file and the new package ships a different version of it. If no prompt appears, your configuration files were kept as they are and there is nothing to merge.
If it does prompt, there is no "merge" option. The recommended approach is to use the new file as the base: 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.
Do this before running the upgrade script — the script reads the configuration file for your database connection settings and fails without them. If this version needs no upgrade script, do it before starting the service.
Caution
If you are upgrading from 4.3.1.x, you must run the script below. However, if you are upgrading from version 4.4.x, DO NOT run the upgrade script; proceed directly to starting the service.
Upgrading from 4.4.x
You don't need to install the patches in between. When 4.4.1 starts, it applies the database changes
of every patch since your version in the background.
When the update is done, the log shows System data patch update completed successfully. In a cluster,
only one core node writes this line, so check the logs of all core nodes.
If the log shows Failed to apply system data patch updates, ThingsBoard keeps running, but the update
isn't complete. The error logged with this line shows the cause. The update runs as the database user from your
ThingsBoard configuration, so that user needs rights to create and change tables, indexes, views, and functions.
Fix the cause and restart ThingsBoard: it retries the update on every start.
sudo /usr/share/thingsboard/bin/install/upgrade.sh
Start the service
sudo service thingsboard start