Migrate from old Docker deployment files
This guide helps you migrate from old Trendz Docker deployment files that used local folder volume bindings to the current named Docker volumes approach. Named volumes are more portable and easier to manage.
Who needs this guide
Section titled “Who needs this guide”You need this guide if your docker-compose.yml uses local folder mounts like ~/.mytrendz-data and
~/.mytrendz-logs for Trendz and Postgres data:
volumes: - ~/.mytrendz-data:/data - ~/.mytrendz-logs:/var/log/trendzFull example of the old docker-compose.yml
version: '3.0'services: mytrendz: restart: always image: "thingsboard/trendz:1.14.0" ports: - "8888:8888" environment: TB_API_URL: http://10.0.0.101:8080 TRENDZ_LICENSE_INSTANCE_DATA_FILE: /data/license.data SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/trendz SPRING_DATASOURCE_USERNAME: postgres SPRING_DATASOURCE_PASSWORD: postgres SCRIPT_ENGINE_TIMEOUT: 30000 volumes: - ~/.mytrendz-data:/data - ~/.mytrendz-logs:/var/log/trendz postgres: restart: always image: "postgres:15" ports: - "5432" environment: POSTGRES_DB: trendz POSTGRES_PASSWORD: postgres volumes: - ~/.mytrendz-data/db:/var/lib/postgresql/dataMigration steps
Section titled “Migration steps”-
Create a named volume for Postgres and copy data into it:
Terminal window docker volume create --name trendz-postgres-datadocker run --rm -v ~/.mytrendz-data/db:/source -v trendz-postgres-data:/destination alpine sh -c "cp -rp /source/* /destination/" -
Create a named volume for Trendz and copy data into it:
Terminal window docker volume create --name trendz-datadocker run --rm -v ~/.mytrendz-data/:/source -v trendz-data:/destination alpine sh -c "cp -rp /source/* /destination/" -
Replace
docker-compose.ymlwith the current manifest:Terminal window nano docker-compose.ymlCopy the current manifest from the Docker (Linux, macOS) installation guide (or the Windows guide if applicable). If you are staying on
postgres:15, update the Postgres image tag accordingly. -
Proceed with the upgrade:
Once your data is in named volumes and
docker-compose.ymlmatches the current structure, follow the Upgrade Instructions.