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 4.1.0
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.0.1EDGE|thingsboard/tb-edge:4.1.0EDGE|' 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