Stand with Ukraine flag
Pricing Try it now
Professional Edition
Getting Started Documentation Devices Library Guides Installation Architecture API FAQ
On this page

Migrate from old Docker deployment files

This guide will help you to move from the old deployment files for Docker installation using deprecated image thingsboard/tb-pe and volume bindings instead of local volumes. This guide covers standalone ThingsBoard PE installation.

Why deployment files were changed?

  • they used deprecated image thingsboard/tb-pe without arm64 architecture support.
  • data was persited in local folders with specific ownerships instead of Docker volumes mechanism

Who needs this guide?

Customers who has docker compose file as below or similar:

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
32
33
34
35
version: '3.0'
services:
  mytbpe:
    restart: always
    image: "thingsboard/tb-pe:4.1.0PE"
    ports:
      - "8080:8080"
      - "1883:1883"
      - "7070:7070"
      - "5683-5688:5683-5688/udp"
    environment:
      TB_QUEUE_TYPE: in-memory
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/thingsboard
      TB_LICENSE_SECRET: PUT_YOUR_LICENSE_SECRET_HERE
      TB_LICENSE_INSTANCE_DATA_FILE: /data/license.data
    volumes:
      - mytbpe-data:/data
      - mytbpe-logs:/var/log/thingsboard
  postgres:
    restart: always
    image: "postgres:15"
    ports:
    - "5432"
    environment:
      POSTGRES_DB: thingsboard
      POSTGRES_PASSWORD: postgres
    volumes:
      - mytbpe-data-db:/var/lib/postgresql/data
volumes:
  mytbpe-data:
    external: true
  mytbpe-logs:
    external: true
  mytbpe-data-db:
    external: true

Move Postgres data to Docker volume

Create a named Docker volume:

1
docker volume create --name tb-postgres-data

Run container with attached volumes to copy data from folder to newly created volume

1
docker run --rm -v mytbpe-data-db:/source -v tb-postgres-data:/destination alpine sh -c "cp -rp /source/* /destination/"
Doc info icon

Note that previously we have PostgreSQL 15 image in our docker compose, which is replaced with PostgreSQL 16 now. In order to start Postgres DB container you need either use postgres:15 image in new deployment files or upgrade database files

Move License data to Docker volume

Create a named Docker volume:

1
docker volume create --name tb-pe-license-data

Run container with attached volumes to copy data from folder to newly created volume:

1
docker run --rm -v mytbpe-data:/source -v tb-pe-license-data:/destination alpine sh -c "cp -a /source/license.data /destination/ && chown 799:799 /destination/license.data"

Move to new deployment files

Open docker-compose.yml file with text editor:

1
notepad docker-compose.yml

Copy current Docker Compose manifest and replace old one with current manifest. Replace Postgres docker image if needed.

Doc info icon

Make sure that thingsboard/tb-pe-node and thingsboard/tb-web-report have the same tag as your previous manifests

Don’t forget to replace license key in the environment variables section.

After data is moved to the docker volumes and docker-compose.yml file have the same structure as the installation example - you can proceed with upgrade of the ThingsBoard.