- Prepare for upgrading ThingsBoard Edge
- Upgrading Edge PE to 3.6.4
- Upgrading Edge PE to 3.6.3
- Upgrading Edge PE to 3.6.2
- Upgrading Edge PE to 3.6.1
- Upgrading Edge PE to 3.6.0
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 PE to 3.6.4
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.3EDGEPE|thingsboard/tb-edge:3.6.4EDGEPE|' 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 PE to 3.6.3
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.2EDGEPE|thingsboard/tb-edge:3.6.3EDGEPE|' 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 PE to 3.6.2
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.2EDGEPE 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:
Modify the main docker compose file (docker-compose.yml) for ThingsBoard Edge and update the image version:
1
sed -i 's|thingsboard/tb-edge-pe:3.6.1EDGEPE|thingsboard/tb-edge-pe:3.6.2EDGEPE|' docker-compose.yml
To start this docker compose, run the following command:
1
docker compose up -d && docker compose logs -f mytbedge
Upgrading Edge PE to 3.6.1
Execute the following command to pull 3.6.1EDGEPE image:
1
docker pull thingsboard/tb-edge-pe:3.6.1EDGEPE
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:
Modify the main docker compose file (docker-compose.yml) for ThingsBoard Edge and update the image version:
1
sed -i 's|thingsboard/tb-edge-pe:3.6.0EDGEPE|thingsboard/tb-edge-pe:3.6.1EDGEPE|' docker-compose.yml
To start this docker compose , run the following command:
1
docker compose up -d && docker compose logs -f mytbedge
Upgrading Edge PE to 3.6.0
Execute the following command to pull 3.6.0EDGEPE image:
1
docker pull thingsboard/tb-edge-pe:3.6.0EDGEPE
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:
Modify the main docker compose file (docker-compose.yml) for ThingsBoard Edge and update the image version:
1
sed -i 's|thingsboard/tb-edge-pe:3.5.1.1EDGEPE|thingsboard/tb-edge-pe:3.6.0EDGEPE|' docker-compose.yml
To start this docker compose , run the following command:
1
docker compose up -d && docker compose logs -f mytbedge