Ignition in Docker - trouble getting restore backup on startup to work

Hi, I'm fairly new to ignition, and I'm on a project to create an Ignition in Docker deployment for demo purposes.
I have created a docker compose yaml that creates containers for the ignition and database server, but I would like to run a backup restore on the ignition instance on startup using the -r command.
I have checked inside the running container that the restore.gwbk file is correctly copied to the //gw-backup folder inside the ignition container, but the restore never seems to run. Our projects aren't installed.
It does however produce this line in the messages on the terminal when I do docker compose up:
ignition-1 | init | 2024/01/20 18:48:55 | Parsed restoreFilePath argument; new value: //gw-backup/restore.gwbk

Here's my Docker compose file.
Does the name of the Ignition instance in the container have to correspond to the name of the Ignition instance in the backup for it to work correctly? Or have I made some other trivial error in the compose file.

services:
  ignition:
    image: inductiveautomation/ignition:8.1.36
    hostname: ignition
    ports:
      - 9988:8088
    volumes:
      - ignition-data:/usr/local/bin/ignition/data
      - ./gw-backup:/gw-backup
      - ./external-modules/kanoaCore011324.modl:/usr/local/bin/ignition/user-lib/modules/kanoaCore011324.modl
      - ./external-modules/kanoaOps011324.modl:/usr/local/bin/ignition/user-lib/modules/kanoaOps011324.modl
      - ./external-modules/BIJC_Calendar_Component_v1.8.1.modl:/usr/local/bin/ignition/user-lib/modules/BIJC_Calendar_Component_v1.8.1.modl
    networks:
      - ignition
      - backend
    environment:
      IGNITION_EDITION: standard
      GATEWAY_ADMIN_PASSWORD: password
      ACCEPT_IGNITION_EULA: Y
      DISABLE_QUICKSTART: true
    command: >
      -n ignition-gateway
      -r //gw-backup/restore.gwbk
  database:
    image: mcr.microsoft.com/mssql/server:2019-latest
    ports: 
      - 1433:1433
    volumes:
      - database-data:/var/opt/mssql
    networks:
      - backend
    environment:
      ACCEPT_EULA: Y
      MSSQL_SA_PASSWORD: PASSWORD
      MSSQL_PID: Express  
networks:
  ignition:
  backend:
volumes:
  ignition-data:
  database-data:

Thanks a lot in advance, it will be great if we can get this to work.

Hi Jim,

You may need to adjust the ./gw-backup:/gw-backup volume into the format " - v /path/to/gateway .gwbk: /restore .gwbk" where the path to the .gwbk is included to the left of the :, and the right side will be the renamed .gwbk file that -r will be called on.

Please refer to our documentation on Docker Images below:

https://docs.inductiveautomation.com/display/DOC81/Docker+Image#DockerImage-AutomatingtheRestoreofaGatewayBackup

If you're still experiencing issues with the .yaml, please contact our support department, and share the logs from the Docker image, and Ignition logs located in usr/local/bin/ignition/logs.

No, these names don't have to align. If you're specifying the gateway name via runtime args (-n ignition-gateway), it will take precedence over what is in the GWBK.

Only things I see on first pass are:

  • You don't need that extra leading / in your -r /gw-backup/restore.gwbk arg, though I think it will still work as-is.
  • You'll probably need a more complex base MSSQL_SA_PASSWORD for the SQL Server container, it usually needs to meet some minimum complexity threshold to start.

Past that, keep in mind that Ignition will only restore that GWBK against an empty volume. So make sure that you do a docker compose down -v to stop and remove all containers and volumes (:warning: WARNING: this will wipe the slate clean for this Compose stack across all defined services/volumes).

Thanks for your help Ben!

1 Like

Thanks for your help!