Hi, to all. One of my clients has been using a docker container with zammad 5.2 for several years. now he wants to update to the latest version. what’s the safest way to do this? According to the official documentation, all I need are these 6 commands:
$ docker-compose stop
$ git pull
$ docker-compose pull
$ docker-compose up
GIT_BRANCH=develop docker-compose -f docker-compose-build.yml up
GIT_BRANCH=develop docker-compose -f docker-compose-build.yml build –no-cache
right? Or are there any pitfalls?
And also, how to properly make a backup before the update? thanks in advance.
I don’t have any experience with the docker version of Zammad, but have a little experience with running it in kubernetes. Before testing on the prod machine, you could spin up a staging env and test a backup of the prod db to see if you have any problems on the latest version. Here are the steps I took in order to migrate from 5.1.x to 6.2.x on a newer k8s cluster when I was testing. It is the k8s commands, but they should be easy enough to translate to docker. Hopefully its helpful.
Exec into the postgres container kubectl -n {namespace} exec -it {container-name} -- /bin/bash
Backup the DB pg_dump -U zammad zammad_production > /tmp/backup.sql
Spin up a new instance of zammad
Move that backup file to a volume on the new instance
Exec into the new postgres container kubectl -n {namespace} exec -it {container-name} -- /bin/bash
Enter the postgres db and kill connections and drop the db. psql -U zammad postgres and select pg_terminate_backend(pid) from pg_stat_activity where datname='zammad_production'; DROP DATABASE zammad_production;
Recreate the db fresh psql -U zammad template1 -c 'create database zammad_production;'
Restore the data from your backup file to the db psql -U zammad -d zammad_production < /tmp/backup.sql
Previous to this I had no kubernetes or database experience at all, but it worked just fine when I was testing on a completely separate cluster using the data from the prod one.