Skip to content
Stand with Ukraine flag

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.

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/trendz
Full 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/data
  1. Create a named volume for Postgres and copy data into it:

    Terminal window
    docker volume create --name trendz-postgres-data
    docker run --rm -v ~/.mytrendz-data/db:/source -v trendz-postgres-data:/destination alpine sh -c "cp -rp /source/* /destination/"
  2. Create a named volume for Trendz and copy data into it:

    Terminal window
    docker volume create --name trendz-data
    docker run --rm -v ~/.mytrendz-data/:/source -v trendz-data:/destination alpine sh -c "cp -rp /source/* /destination/"
  3. Replace docker-compose.yml with the current manifest:

    Terminal window
    nano docker-compose.yml

    Copy 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.

  4. Proceed with the upgrade:

    Once your data is in named volumes and docker-compose.yml matches the current structure, follow the Upgrade Instructions.