Share: Migration 6.3.1 to 6.5.0

Zammad Migration Guide (6.3.1 → 6.5.0)

Not official!
Not official!
Not official!

Environment:

  • Zammad: Docker-compose
  • OS: Ubuntu 20.04

Critical Warning:
Back up your whole Zammad files!
Back up your whole Zammad files!
Back up your whole Zammad files!

Preparation

  1. Stop services and create backups:
cd zammad-docker-compose
docker-compose down
cd ..
tar -czvf zammad-docker-compose.tar.gz  zammad-docker-compose/

Now you get a backup for zammad; also you can backup twice

cp -a zammad-docker-compose/  zammad-docker-compose-bak/

I have persisted the contents of some containers, such as postgresql and es, zammad-backup。
my docker yml likes:

- ./elasticsearch-data:/bitnami/elasticsearch/data
- ./zammad-backup:/var/tmp/zammad
- ./postgresql-data:/var/lib/postgresql/data

get the new yaml by the url : GitHub - zammad/zammad-docker-compose: Zammad Docker images for docker-compose & Kubernetes

change the same for yourself like the local volumes; [This is the new version docker-compose.yml]

1.mv your old docker yml

cd zammad-docker-compose
mv docker-compose.yml  docker-compose.yml-bak

2.git pull

git pull 

3.get the sql backup file

cd zammad-backup/
cp -a 20250325*.gz  ../
  1. delete the old local volumes file
rm -rf postgres-data/
rm -rf elasticsearch-data/

6.copy the new docker-compose.yml or change the same for yourself like the local volumes;

vim docker-compose.yml  

7.run command and restore the pgsql

docker-compose up -d zammad-postgresql
docker cp 2025*_zammad_db.psql.gz  zammad-docker-compose_zammad-postgresql_1:/tmp/
docker exec -it zammad-docker-compose_zammad-postgresql_1  /bin/bash
gunzip -c /tmp/2025*_zammad_db.psql.gz | psql -U zammad -d zammad_production
exit 
docker-compose exec web bundle exec rails db:migrate

now you have finish the sql restore ;
8.run all containers
the uid maybe change to the zammad user ;

rm -rf elasticsearch-data/ &&  mkdir  elasticsearch-data 
sudo chown -R 1001:1001 ./elasticsearch-data
sudo chmod -R 775 ./elasticsearch-data
docker-compose up -d 

F&Q:
1.may will met the errors for es :

Unable to process GET request to elasticsearch URL 'http://zammad-elasticsearch:9200'. Elasticsearch is not reachable. It's possible that it's not running. Please check whether it is installed.

Response:
#<UserAgent::Result:0x00007f0aea46ac98 @success=false, @body=nil, @data=nil, @code=0, @content_type=nil, @error="#<Errno::ECONNREFUSED: Failed to open TCP connection to zammad-elasticsearch:9200 (Connection refused - connect(2) for \"zammad-elasticsearch\" port 9200)>", @header=nil>

Payload:
null

Payload size: 0M

my solution is :

docker-compose exec web bundle exec rails r "Setting.set('es_url', 'http://zammad-elasticsearch:9200')"
docker-compose exec web bundle exec rake searchindex:rebuild

2.Fix errors for system monitor
errors:

Failed to run background job #1 'SearchIndexAssociationsJob' 4 time(s) with 18 attempt(s).
Failed to run background job #2 'SearchIndexJob' 4 time(s) with 18 attempt(s).
scheduler may not run (last execution of CacheClearJob.perform_now 14 days ago) - please 

Solution:

docker-compose exec web bundle exec rails r "Delayed::Job.where(failed_at: nil).each(&:invoke_job)"
docker-compose restart zammad-scheduler

finish this ,you may also get the errors like : scheduler may not run (last execution of CacheClearJob.perform_now 14 days ago) - please contact your system administrator
you can ignore it ,because second day it is disapperd

1 Like

rake searchindes:rebuild is outdated and deprecated, you’re expected to use rake zammad:searchindex:rebuild

Restarting the failed background jobs manually shouldn’t be needed at all and should self heal within some time.

maybe , at least , i had done it and not met errror for es ;