ThingsBoard Documentation

Documentation for using ThingsBoard IoT Platform.
ThingsBoard Professional Edition with White-labeling and Platform Integrations Learn More

Upgrading ThingsBoard PE from AWS Marketplace

This guide describes how to upgrade ThingsBoard Professional Edition from AWS Marketplace.

Upgrading to ThingsBoard PE v.2.0.2

These steps are applicable for ThingsBoard PE with Cassandra v.1.4.


Important note


Please note that during upgrade procedure old rules and plugins will be completely removed from your ThingsBoard instance.

Old rules and plugins functionality is replaced by new rule engine components (rule chains and rule nodes).

If you have configured rules or plugins you need to backup them using export function before performing upgrade. After upgrade you will need to configure new rule chains in order to restore your application logic performed by old rules/plugins.

Please refer to new rule engine documentation for details.

Connect to your ThingsBoard PE v.1.4 instance over SSH.

Below is example command as a reference:

$ ssh -i <PRIVATE-KEY> [email protected]<PUBLIC_DNS_NAME>

or goto EC2 instances and locate your ThingsBoard PE v1.4 instance. Then select Actions -> Connect and follow instructions provided in Connect To Your Instance dialog.

Upgrade ThingsBoard PE package

In the console execute the following command:

$ sudo tb-update-pkg.sh

The output should be like:

Updating ThingsBoard Professional Edition...
Installing ThingsBoard PE package...
(Reading database ... 104150 files and directories currently installed.)
Preparing to unpack /tmp/tb.deb ...
Unpacking thingsboard (2.0.2PE-1) over (1.4.0PE-1) ...
Setting up thingsboard (2.0.2PE-1) ...

NOTE: Package installer will ask you to merge your thingsboard.conf configuration.

Configuration file '/usr/share/thingsboard/conf/thingsboard.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** thingsboard.conf (Y/I/N/O/D/Z) [default=N] ? Y

Select install the package maintainer’s version by entering Y or I.

NOTE: Package installer will ask you to merge your thingsboard.yml configuration.

Configuration file '/usr/share/thingsboard/conf/thingsboard.yml'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** thingsboard.yml (Y/I/N/O/D/Z) [default=N] ? Y

Select install the package maintainer’s version by entering Y or I.

After installation your previous configuration will be stored in the following files:

/usr/share/thingsboard/conf/thingsboard.conf.dpkg-old
/usr/share/thingsboard/conf/thingsboard.yml.dpkg-old

If you changed configuration files previously you can compare new configuration with the old one in order to restore your configuration values.

At least the following configuration parameters should be restored:

$ sudo vi /usr/share/thingsboard/conf/thingsboard.conf
   ...
   export JAVA_OPTS="$JAVA_OPTS -Dplatform=ami-pe-cassandra -Dinstall.data_dir=/usr/share/thingsboard/data"
   ...
$ sudo vi /usr/share/thingsboard/conf/thingsboard.yml
   database:
     type: "${DATABASE_TYPE:sql}" # cassandra OR sql
   database:
     type: "${DATABASE_TYPE:cassandra}" # cassandra OR sql

Upgrade Database

Execute database upgrade using the following command:

$ sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=1.4.0

The output should be like:

 ===================================================
 :: ThingsBoard Professional Edition ::       (v2.0.2PE)
 ===================================================

Starting ThingsBoard Upgrade from version 1.4.0 ...
Upgrading ThingsBoard from version 1.4.0 to 2.0.0 ...
Updating schema ...
Schema updated.
Updating data from version 1.4.0 to 2.0.0 ...
Updating system data...
Upgrading ThingsBoard from version 2.0.0 to 2.0.0PE ...
Updating schema ...
Schema updated.
Updating converters ...
Converters updated.
Updating data from version 2.0.0 to 2.0.0PE ...
Upgrade finished successfully!
ThingsBoard upgraded successfully!

In case of any failures during database upgrade Please contact [email protected].

Start ThingsBoard PE service

Execute the following command in order to start ThingsBoard service:

$ sudo service thingsboard start

You can issue the following command in order to check if there are any errors on the backend side:

$ cat /var/log/thingsboard/thingsboard.log | grep ERROR

Upgrading to ThingsBoard PE v.2.1.0

These steps are applicable for ThingsBoard PE with Cassandra v.2.0.2.

Connect to your ThingsBoard PE v.2.0.2 instance over SSH.

Below is example command as a reference:

$ ssh -i <PRIVATE-KEY> [email protected]<PUBLIC_DNS_NAME>

or goto EC2 instances and locate your ThingsBoard PE v2.0.2 instance. Then select Actions -> Connect and follow instructions provided in Connect To Your Instance dialog.

Upgrade ThingsBoard PE package

In the console execute the following command:

$ sudo tb-update-pkg.sh

The output should be like:

Updating ThingsBoard Professional Edition...
Installing ThingsBoard PE package...
(Reading database ... 104150 files and directories currently installed.)
Preparing to unpack /tmp/tb.deb ...
Unpacking thingsboard (2.1.0PE-1) over (2.0.2PE-1) ...
Setting up thingsboard (2.1.0PE-1) ...

NOTE: Package installer will ask you to merge your thingsboard.conf configuration.

Configuration file '/usr/share/thingsboard/conf/thingsboard.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** thingsboard.conf (Y/I/N/O/D/Z) [default=N] ? Y

Select install the package maintainer’s version by entering Y or I.

NOTE: Package installer will ask you to merge your thingsboard.yml configuration.

Configuration file '/usr/share/thingsboard/conf/thingsboard.yml'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** thingsboard.yml (Y/I/N/O/D/Z) [default=N] ? Y

Select install the package maintainer’s version by entering Y or I.

After installation your previous configuration will be stored in the following files:

/usr/share/thingsboard/conf/thingsboard.conf.dpkg-old
/usr/share/thingsboard/conf/thingsboard.yml.dpkg-old

If you changed configuration files previously you can compare new configuration with the old one in order to restore your configuration values.

At least the following configuration parameters should be restored:

$ sudo vi /usr/share/thingsboard/conf/thingsboard.conf
   ...
   export JAVA_OPTS="$JAVA_OPTS -Dplatform=ami-pe-cassandra -Dinstall.data_dir=/usr/share/thingsboard/data"
   ...
$ sudo vi /usr/share/thingsboard/conf/thingsboard.yml
   database:
     type: "${DATABASE_TYPE:sql}" # cassandra OR sql
   database:
     type: "${DATABASE_TYPE:cassandra}" # cassandra OR sql

Upgrade Database

Execute database upgrade using the following command:

$ sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=2.0.0

The output should be like:

 ===================================================
 :: ThingsBoard Professional Edition ::       (v2.1.0PE)
 ===================================================

Starting ThingsBoard Upgrade from version 2.0.0 ...
Upgrading ThingsBoard from version 2.0.0 to 2.1.0PE ...
Updating schema ...
Schema updated.
Updating converters ...
Converters updated.
Updating data from version 2.0.0 to 2.1.0PE ...
Upgrade finished successfully!
ThingsBoard upgraded successfully!

In case of any failures during database upgrade Please contact [email protected].

Start ThingsBoard PE service

Execute the following command in order to start ThingsBoard service:

$ sudo service thingsboard start

You can issue the following command in order to check if there are any errors on the backend side:

$ cat /var/log/thingsboard/thingsboard.log | grep ERROR

Install ThingsBoard Web Report Server

Execute the following command in order to install Report Server prerequisites:

$ sudo apt install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
     libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
     libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
     libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
     ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget fonts-roboto

Download ThingsBoard Web Report Server installation script:

$ cd ~
$ wget --quiet -O tb-install-web-report.sh https://thingsboard.io/docs/user-guide/install/resources/tb-install-web-report.sh
$ chmod +x tb-install-web-report.sh

Execute installation script:

$ sudo ./tb-install-web-report.sh

The output should be like:

Installing ThingsBoard Web Report Server...
Installing ThingsBoard Web Report Server package...
Selecting previously unselected package tb-web-report.
(Reading database ... 145356 files and directories currently installed.)
Preparing to unpack /tmp/tb-web-report.deb ...
Unpacking tb-web-report (2.1.0PE-1) ...
Setting up tb-web-report (2.1.0PE-1) ...
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Latest version of ThingsBoard Web Report Server has been installed.

Start ThingsBoard Web Report Server

Execute the following command in order to start ThingsBoard Web Report Server:

$ sudo service tb-web-report start