Migrating from Zammad package install to Docker: Best practices?

I’m planning out the migration process of Zammad from a package installation on my server to a docker-compose driven installation on the same host but I have some questions regarding the restoration script.

  1. The restore script restores both files and the DB. Since the intention of Docker is for container storage to be ephemeral, shouldn’t restoring files be optional? (attachments can be stored in either DB or S3)

  2. The restore script expects the filepath for backups to be /var/tmp/zammad_backup however the docker-compose file’s default value for the BACKUP_DIR environment variable is /var/tmp/zammad so the restore fails. Users should be given the option to enter a different backup dir structure or default to the original default value.

  3. After creating a symlink for /var/tmp/zammad_backup that points to the default docker-compose location, I receive the following error:

tar: opt/zammad/storage: Cannot utime: Read-only file system
tar: opt/zammad/storage: Cannot change ownership to uid 1000, gid 1000: Read-only file system
tar: Exiting with failure status due to previous errors

At this point, my best option seems to be:

  1. Mounting the backup directory to the postgres service and do a direct DB restore from the backup file
  2. Clear Rails cache
  3. Run a full Elasticsearch reindex

Are there better ways to approach this process? It seems like the restore script is in need of some updates for Docker-based installs.

1 Like