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

ThingsBoard Edge CE v3.6.x upgrade instructions for Docker

Prepare for upgrading ThingsBoard Edge

Back up your ThingsBoard Edge data before upgrading.

Stop the Edge container

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

1
docker compose stop

Backup the database volume

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 3.6.4

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 3.6.3EDGE version.

Doc info icon

These steps are applicable for Edge 3.6.3EDGE 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:3.6.3EDGE|thingsboard/tb-edge:3.6.4EDGE|' docker-compose.yml

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 3.6.3

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 3.6.2EDGE version.

Doc info icon

These steps are applicable for Edge 3.6.2EDGE 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:3.6.2EDGE|thingsboard/tb-edge:3.6.3EDGE|' docker-compose.yml

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 3.6.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 3.6.1EDGE version.

Doc info icon

These steps are applicable for Edge 3.6.1EDGE 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 && docker compose rm mytbedge -f

Migrating Data from Docker Bind Mount Folders to Docker Volumes

Starting with the 3.6.2EDGE release, the ThingsBoard team has moved from using Docker bind mount folders to Docker volumes. The goal of this change is to improve security and efficiency when storing data for Docker containers, and to mitigate permissions issues in different environments.

To migrate from Docker bind mounts to Docker volumes, please execute the following commands:

1
2
3
docker run --rm -v tb-edge-data:/volume -v ~/.mytb-edge-data:/backup busybox sh -c "cp -a /backup/. /volume"
docker run --rm -v tb-edge-logs:/volume -v ~/.mytb-edge-logs:/backup busybox sh -c "cp -a /backup/. /volume"
docker run --rm -v tb-edge-postgres-data:/volume -v ~/.mytb-edge-data/db:/backup busybox sh -c "cp -a /backup/. /volume"

After the data migration to the newly created Docker volumes is complete, you’ll need to update the volume mounts in your Docker Compose configuration. Modify the `docker-compose.yml’ file for ThingsBoard Edge to update the volume settings.

First, please update docker compose file version. Find the next snippet:

1
2
version: '3.0'
...

And replace it with:

1
version: '3.8'

Then update the volume mounts. Locate the following snippet:

1
2
3
4
    volumes:
      - ~/.mytb-edge-data:/data
      - ~/.mytb-edge-logs:/var/log/tb-edge
...

And replace it with:

1
2
3
    volumes:
      - tb-edge-data:/data
      - tb-edge-logs:/var/log/tb-edge

Apply a similar update to the PostgreSQL service. Locate the section:

1
2
3
    volumes:
      - ~/.mytb-edge-data/db:/var/lib/postgresql/data
...

And replace it with:

1
2
    volumes:
      - tb-edge-postgres-data:/var/lib/postgresql/data

Finally, add the following volume section to the end of the file:

1
2
3
4
5
6
7
volumes:
  tb-edge-data:
    name: tb-edge-data
  tb-edge-logs:
    name: tb-edge-logs
  tb-edge-postgres-data:
    name: tb-edge-postgres-data

Backup Database

Before upgrading, make a 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"

The next step creates a docker compose file for the ThingsBoard Edge upgrade process and runs the upgrade. Once the upgrade process is successfully completed, the TB Edge upgrade container is automatically stopped:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cat > docker-compose-upgrade.yml <<EOF && docker compose -f docker-compose-upgrade.yml up --abort-on-container-exit
version: '3.8'
services:
  mytbedge:
    restart: on-failure
    image: "thingsboard/tb-edge:3.6.2EDGE"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge
    volumes:
      - tb-edge-data:/data
      - tb-edge-logs:/var/log/tb-edge
    entrypoint: upgrade-tb-edge.sh
  postgres:
    restart: always
    image: "postgres:15"
    ports:
      - "5432"
    environment:
      POSTGRES_DB: tb-edge
      POSTGRES_PASSWORD: postgres
    volumes:
      - tb-edge-postgres-data:/var/lib/postgresql/data

volumes:
  tb-edge-data:
    name: tb-edge-data
  tb-edge-logs:
    name: tb-edge-logs
  tb-edge-postgres-data:
    name: tb-edge-postgres-data
EOF

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

1
sed -i 's|thingsboard/tb-edge:3.6.1EDGE|thingsboard/tb-edge:3.6.2EDGE|' docker-compose.yml

To start this docker compose, run the following command:

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

Upgrading Edge CE to 3.6.1

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 3.6.0EDGE version.

Doc info icon

These steps are applicable for Edge 3.6.0EDGE version.

Execute the following command to pull 3.6.1EDGE image:

1
docker pull thingsboard/tb-edge:3.6.1EDGE

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 && docker compose rm mytbedge -f

The next step creates a docker compose file for the ThingsBoard Edge upgrade process and runs the upgrade. Once the upgrade process is successfully completed, the TB Edge upgrade container is automatically stopped:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cat > docker-compose-upgrade.yml <<EOF && docker compose -f docker-compose-upgrade.yml up --abort-on-container-exit
version: '3.0'
services:
  mytbedge:
    restart: on-failure
    image: "thingsboard/tb-edge:3.6.1EDGE"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge
    volumes:
      - ~/.mytb-edge-data:/data
      - ~/.mytb-edge-logs:/var/log/tb-edge
    entrypoint: upgrade-tb-edge.sh
  postgres:
    restart: always
    image: "postgres:15"
    ports:
      - "5432"
    environment:
      POSTGRES_DB: tb-edge
      POSTGRES_PASSWORD: postgres
    volumes:
      - ~/.mytb-edge-data/db:/var/lib/postgresql/data
EOF

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

1
sed -i 's|thingsboard/tb-edge:3.6.0EDGE|thingsboard/tb-edge:3.6.1EDGE|' docker-compose.yml

To start this docker compose , run the following command:

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

Upgrading Edge CE to 3.6.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 3.5.1.1EDGE version.

Doc info icon

These steps are applicable for Edge 3.5.1.1EDGE version.

Execute the following command to pull 3.6.0EDGE image:

1
docker pull thingsboard/tb-edge:3.6.0EDGE

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 && docker compose rm mytbedge -f

The next step creates a docker compose file for the ThingsBoard Edge upgrade process and runs the upgrade. Once the upgrade process is successfully completed, the TB Edge upgrade container is automatically stopped:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cat > docker-compose-upgrade.yml <<EOF && docker compose -f docker-compose-upgrade.yml up --abort-on-container-exit
version: '3.0'
services:
  mytbedge:
    restart: on-failure
    image: "thingsboard/tb-edge:3.6.0EDGE"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge
    volumes:
      - ~/.mytb-edge-data:/data
      - ~/.mytb-edge-logs:/var/log/tb-edge
    entrypoint: upgrade-tb-edge.sh
  postgres:
    restart: always
    image: "postgres:15"
    ports:
      - "5432"
    environment:
      POSTGRES_DB: tb-edge
      POSTGRES_PASSWORD: postgres
    volumes:
      - ~/.mytb-edge-data/db:/var/lib/postgresql/data
EOF

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

1
sed -i 's|thingsboard/tb-edge:3.5.1.1EDGE|thingsboard/tb-edge:3.6.0EDGE|' docker-compose.yml

To start this docker compose , run the following command:

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