Upgrade docker zwzvejs2mqtt without loosing any changes

Guys I have set the zwavejs2mqtt in a docker and started it using the yaml file below using docker-compose up --detach. How can I upgrade without loosing any changes?

services:
  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: zwavejs/zwavejs2mqtt:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=mysupersecretkey
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      # Uncomment if you want logs time and dates to match your timezone instead of UTC
      # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      #- TZ=America/New_York
      - TZ=Asia/Nicosia
    networks:
      - zwave
    devices:
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/zwave:/dev/zwave'
    volumes:
      - zwave-config:/usr/src/app/store
    ports:
      - '8091:8091' # port for web interface
      - '3000:3000' # port for Z-Wave JS websocket server
networks:
  zwave:
volumes:
  zwave-config:
    name: zwave-config

All your information should be stored in your external config file, so … you should not loose anything

1 Like

@GlennHA
I would be very grateful if you are more precise with the steps in order to migrate this since I do not have any experience with Dockers.

Your files are stores in this local folder: /usr/src/app/store

You van simply stop your container and update it. I’m not sure about the commands becausd i use portainer.

1 Like

I interpreted the question as how to prevent loosing data.

I use portainer also as @Giel538 stated he does; this is by far the easiest way to do it; but if you don’t have portainer then:
(depending on how you set up docker you may need ‘sudo’ in front of the below commands)
This command will download the latest image

docker pull zwavejs/zwavejs2mqtt:latest

Stop the running container and remove it:

docker stop zwavejs2mqtt && sudo docker rm zwavejs2mqtt

I don’t use docker compose so I will give you what I do:

docker run -d --name zwavejs2mqtt -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 -v /home/glenn/zwavejs2mqtt_config:/usr/src/app/store zwavejs/zwavejs2mqtt:latest

You can combine commands with the && symbol to pull and run newest if you want.