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.
1
| sudo systemctl stop thingsboard
|
1
| 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.
1
| sudo systemctl status postgresql
|
Make sure you have enough space to place a backup of the database
Check database size
1
| 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.
1
| 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.
1
| sudo systemctl status cassandra
|
Flush all memtables from the node to SSTables on disk.
Stop Cassandra.
1
| sudo systemctl stop cassandra
|
And you have to check the status again to ensure they are surely stopped.
1
| sudo systemctl status cassandra
|
Make sure you have enough space to place a backup of the database
Check database size.
1
| du -h /var/lib/cassandra/ | tail -1
|
Check free space.
Make a backup of Cassandra database.
1
2
| mkdir backup
sudo tar -cvf backup/cassandra.tar /var/lib/cassandra
|
Check archive being created
Start Database
Cassandra
1
| sudo systemctl start cassandra
|
PostgreSQL
Do nothing, postgresql is already running.
Upgrading ThingsBoard PE to 3.3.4.1
NOTE:
These upgrade steps are applicable for ThingsBoard version 3.3.4PE. In order to upgrade to 3.3.4.1PE you need to upgrade to 3.3.4PE first.
Prepare for upgrading ThingsBoard.
ThingsBoard PE package download
1
| wget https://dist.thingsboard.io/thingsboard-3.3.4.1pe.deb
|
ThingsBoard PE service upgrade
- Stop ThingsBoard service if it is running.
1
| sudo service thingsboard stop
|
- Install Thingsboard Web Report component as described here.
1
| sudo dpkg -i thingsboard-3.3.4.1pe.deb
|
NOTE:
Package installer may ask you to merge your thingsboard configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Start the service
1
| sudo service thingsboard start
|
Upgrading ThingsBoard PE to 3.3.4
NOTE:
These upgrade steps are applicable for ThingsBoard version 3.3.3PE. In order to upgrade to 3.3.4PE you need to upgrade to 3.3.3PE first.
Prepare for upgrading ThingsBoard.
ThingsBoard PE package download
1
| wget https://dist.thingsboard.io/thingsboard-3.3.4pe.deb
|
ThingsBoard PE service upgrade
- Stop ThingsBoard service if it is running.
1
| sudo service thingsboard stop
|
- Install Thingsboard Web Report component as described here.
1
| sudo dpkg -i thingsboard-3.3.4pe.deb
|
NOTE:
Package installer may ask you to merge your thingsboard configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Execute regular upgrade script:
1
| sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=3.3.3
|
Start the service
1
| sudo service thingsboard start
|
Upgrading ThingsBoard PE to 3.3.3
NOTE: These upgrade steps are applicable for ThingsBoard version 3.3.2PE. In order to upgrade to 3.3.3PE you need to upgrade to 3.3.2PE first.
Prepare for upgrading ThingsBoard.
Important note before upgrading to ThingsBoard 3.3.3
ThingsBoard UI was migrated to Angular 12. You need to re-build your custom widgets and rule nodes (which use UI) on Angular 12.
ThingsBoard PE package download
1
| wget https://dist.thingsboard.io/thingsboard-3.3.3pe.deb
|
ThingsBoard PE service upgrade
- Stop ThingsBoard service if it is running.
1
| $ sudo service thingsboard stop
|
- Install Thingsboard Web Report component as described here.
1
| sudo dpkg -i thingsboard-3.3.3pe.deb
|
NOTE: Package installer may ask you to merge your thingsboard configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Execute regular upgrade script:
1
2
| # Execute regular upgrade script
$ sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=3.3.2
|
Start the service
1
| $ sudo service thingsboard start
|
Upgrading ThingsBoard PE to 3.3.2
NOTE: These upgrade steps are applicable for ThingsBoard version 3.3.1PE. In order to upgrade to 3.3.2PE you need to upgrade to 3.3.1PE first.
Prepare for upgrading ThingsBoard.
ThingsBoard PE package download
1
| wget https://dist.thingsboard.io/thingsboard-3.3.2pe.deb
|
ThingsBoard PE service upgrade
- Stop ThingsBoard service if it is running.
1
| $ sudo service thingsboard stop
|
- Install Thingsboard Web Report component as described here.
1
| sudo dpkg -i thingsboard-3.3.2pe.deb
|
NOTE: Package installer may ask you to merge your thingsboard configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Please make sure that you set database.ts.type parameter value (in the file /etc/thingsboard/conf/thingsboard.yml) to “cassandra” instead of “sql” if you are using Cassandra database for timeseries data:
1
2
3
4
| database:
ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records
ts:
type: "${DATABASE_TS_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale)
|
Execute regular upgrade script:
1
2
| # Execute regular upgrade script
$ sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=3.3.1
|
Start the service
If you use Redis for caching, you need to flush all stored keys before starting the ThingsBoard.
Connect to your Redis instance (or container/pod, depending on your setup) and run the command:
redis-cli flushall
Please note that this command is applicable only if you use Redis exclusively for ThingsBoard. If other applications use Redis, you need to locate the ThingsBoard database and flush only that. The default database index is 0, configurable with REDIS_DB ThingsBoard environment value.
redis-cli
select 0
flushdb
1
| $ sudo service thingsboard start
|
Upgrading ThingsBoard PE to 3.3.1
NOTE: These upgrade steps are applicable for ThingsBoard version 3.3.0PE. In order to upgrade to 3.3.1PE you need to upgrade to 3.3.0PE first.
Prepare for upgrading ThingsBoard.
ThingsBoard PE package download
1
| wget https://dist.thingsboard.io/thingsboard-3.3.1pe.deb
|
ThingsBoard PE service upgrade
- Stop ThingsBoard service if it is running.
1
| sudo service thingsboard stop
|
- Install Thingsboard Web Report component as described here.
1
| sudo dpkg -i thingsboard-3.3.1pe.deb
|
NOTE: Package installer may ask you to merge your thingsboard configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Please make sure that you set database.ts.type parameter value (in the file /etc/thingsboard/conf/thingsboard.yml) to “cassandra” instead of “sql” if you are using Cassandra database for timeseries data:
1
2
3
4
| database:
ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records
ts:
type: "${DATABASE_TS_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale)
|
Execute regular upgrade script:
1
| sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=3.3.0
|
Start the service
If you use Redis for caching, you need to flush all stored keys before starting the ThingsBoard.
Connect to your Redis instance (or container/pod, depending on your setup) and run the command:
redis-cli flushall
Please note that this command is applicable only if you use Redis exclusively for ThingsBoard. If other applications use Redis, you need to locate the ThingsBoard database and flush only that. The default database index is 0, configurable with REDIS_DB ThingsBoard environment value.
redis-cli
select 0
flushdb
1
| sudo service thingsboard start
|
Upgrading ThingsBoard PE to 3.3
NOTE: These upgrade steps are applicable for ThingsBoard version 3.2.2PE. In order to upgrade to 3.3PE you need to upgrade to 3.2.2PE first.
Prepare for upgrading ThingsBoard.
ThingsBoard PE package download
1
| wget https://dist.thingsboard.io/thingsboard-3.3pe.deb
|
ThingsBoard PE service upgrade
- Stop ThingsBoard service if it is running.
1
| sudo service thingsboard stop
|
- Install Thingsboard Web Report component as described here.
1
| sudo dpkg -i thingsboard-3.3pe.deb
|
NOTE: Package installer will ask you to merge your thingsboard configuration. It is preferred to use merge option to make sure that all your previous parameters will not be overwritten.
Please make sure that you set database.ts.type parameter value (in the file /etc/thingsboard/conf/thingsboard.yml) to “cassandra” instead of “sql” if you are using Cassandra database for timeseries data:
1
2
3
4
| database:
ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records
ts:
type: "${DATABASE_TS_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale)
|
NOTE: If you were using MQTT over SSL instead of default MQTT, please make sure you have a proper configuration (thingsboard.conf and/or thingsboard.yml) of ports/addresses:
/etc/thingsboard/conf/thingsboard.conf
1
2
3
4
5
6
| export MQTT_SSL_ENABLED=true
export MQTT_SSL_BIND_ADDRESS=0.0.0.0
export MQTT_SSL_BIND_PORT=8883
export MQTT_BIND_ADDRESS=0.0.0.0
export MQTT_BIND_PORT=1883
|
/etc/thingsboard/conf/thingsboard.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| transport:
. . .
# Local MQTT transport parameters
mqtt:
# Enable/disable mqtt transport protocol.
enabled: "${MQTT_ENABLED:true}"
bind_address: "${MQTT_BIND_ADDRESS:0.0.0.0}"
bind_port: "${MQTT_BIND_PORT:1883}"
. . .
ssl:
# Enable/disable SSL support
enabled: "${MQTT_SSL_ENABLED:true}"
# MQTT SSL bind address
bind_address: "${MQTT_SSL_BIND_ADDRESS:0.0.0.0}"
# MQTT SSL bind port
bind_port: "${MQTT_SSL_BIND_PORT:8883}"
|
Execute regular upgrade script:
1
| sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=3.2.2
|
Start the service
If you use Redis for caching, you need to flush all stored keys before starting the ThingsBoard.
Connect to your Redis instance (or container/pod, depending on your setup) and run the command:
redis-cli flushall
Please note that this command is applicable only if you use Redis exclusively for ThingsBoard. If other applications use Redis, you need to locate the ThingsBoard database and flush only that. The default database index is 0, configurable with REDIS_DB ThingsBoard environment value.
redis-cli
select 0
flushdb
1
| sudo service thingsboard start
|