Stand with Ukraine flag
Pricing Try it now
Edge
Getting Started Documentation
Architecture API FAQ
On this page

ThingsBoard Edge CE v4.2.x upgrade instructions for Docker

Backup before upgrading

Doc info icon

Make sure your system has enough free space to store the backup.

Go to your docker-compose.yml directory and stop the container:

1
docker compose stop

Before upgrading, make a backup copy of the database volume:

1
docker run --rm -v tb-edge-postgres-data:/source -v tb-edge-postgres-data-backup:/backup busybox sh -c "cp -a /source/. /backup"

This copies all contents from tb-edge-postgres-data to tb-edge-postgres-data-backup.

Restore the backup (if needed)

Stop the ThingsBoard Edge container (if it’s still running):

1
docker compose stop

To restore data from a backup volume to the main volume, run the following command:

1
docker run --rm -v tb-edge-postgres-data-backup:/source -v tb-edge-postgres-data:/target busybox sh -c "cp -a /source/. /target"

Start the ThingsBoard Edge container:

1
docker compose up -d 

Upgrading Edge CE to 4.2.1 (4.2.1.2)

doc warn icon

Ensure your ThingsBoard Server is up to date before updating ThingsBoard Edge.

If your Server version is outdated, upgrade it first.

The following instructions are applicable for ThingsBoard Edge 4.2.0EDGE version.

Set the terminal in the directory which contains the “docker-compose.yml” file, and run the following command to stop and remove the currently running TB Edge container (if it’s still running):

1
docker compose stop mytbedge

Modify the main docker compose file (docker-compose.yml) for ThingsBoard Edge and update the image version:

1
sed -i 's|thingsboard/tb-edge:4.2.0EDGE|thingsboard/tb-edge:4.2.1.2EDGE|' docker-compose.yml
doc warn icon

If you are upgrading from 4.2.0, you MUST run the script below. However, if you are upgrading from version 4.2.1.x, DO NOT run the upgrade script; proceed directly to starting the Edge service.

Upgrade the ThingsBoard Edge service:

1
docker compose run mytbedge upgrade-tb-edge.sh

To start this docker compose, run the following command:

1
docker compose up -d && docker compose logs -f mytbedge

Upgrading Edge CE to 4.2.0

doc warn icon

Ensure your ThingsBoard Server is up to date before updating ThingsBoard Edge.

If your Server version is outdated, upgrade it first.

The following instructions are applicable for ThingsBoard Edge 4.1.0EDGE version.

Set the terminal in the directory which contains the “docker-compose.yml” file, and run the following command to stop and remove the currently running TB Edge container (if it’s still running):

1
docker compose stop mytbedge

Modify the main docker compose file (docker-compose.yml) for ThingsBoard Edge and update the image version:

1
sed -i 's|thingsboard/tb-edge:4.1.0EDGE|thingsboard/tb-edge:4.2.0EDGE|' docker-compose.yml
doc warn icon

If you are upgrading from 4.1.0, you MUST run the script below.

Upgrade the ThingsBoard Edge service:

1
docker compose run mytbedge upgrade-tb-edge.sh

To start this docker compose, run the following command:

1
docker compose up -d && docker compose logs -f mytbedge