ZAMMAD Restore from docker

Hello everyone, we are faced with the problem of restoring from backup (zammad in docker)
Unfortunately the described method is at

does not work for us.

I tried to manually make changes to the database and restore files. Everything was restored, but here we were faced with another problem: users are not displayed in the web interface, although they are present in the database table.

  • Used Zammad version: -4.0.0-7
  • Used Zammad installation type: (source, package, docker-compose, …)
  • Operating system: Ubuntu 18.4
  • Browser + version: Opera 82.0.4227.43

Expected behavior:

Restore OK

Actual behavior:

error in path config
/opt/zammad/contrib/backup/config.dist
cat: can’t open ‘/opt/zammad/contrib/backup/config.dist’: No such file or directory
etc

Steps to reproduce the behavior:

-//-

Stopping services
# docker-compose stop zammad-nginx zammad-websocket zammad-railsserver zammad-memcached zammad-elasticsearch zammad-scheduler
Drop database content
# docker-compose exec zammad-postgresql su -c 'dropdb zammad_production' - postgres
Start Scheduler again (to recreate empty db)
# docker-compose start zammad-scheduler
Recreate empty database
# docker-compose exec zammad-scheduler bundle exec rake db:create
(Preparing) Restore
# docker-compose exec zammad-postgresql /bin/sh
$ cp /opt/zammad/contrib/backup/config.dist /opt/zammad/contrib/backup/config && \
  sed -i s/zammad_backup/zammad/g /opt/zammad/contrib/backup/config && \
  ln -s /usr/local/bin/psql /usr/bin/ && \
  /opt/zammad/contrib/backup/zammad_restore.sh
Restart whole compose stack
# docker-compose stop; docker-compose start && docker-compose logs -f

How did you manage to do:

  1. Stopping services
    docker-compose stop zammad-nginx zammad-websocket zammad-railsserver zammad-memcached zammad-elasticsearch zammad-scheduler

docker-compose exec zammad-postgresql bash
su - postgres
psql -U zammad
SELECT datname,datistemplate,datallowconn,datconnlimit FROM pg_database;
ALTER DATABASE zammad_production;
DROP DATABASE zammad_production;
\q

docker-compose start zammad-scheduler
docker-compose exec zammad-scheduler bundle exec rake db:create

  1. Copy bkp DB in
    /var/lib/docker/volumes/zammad-docker-compose_postgresql-data/_data/

docker-compose exec zammad-postgresql bash
su - postgres
psql -U zammad
SELECT datname,datistemplate,datallowconn,datconnlimit FROM pg_database;
ALTER DATABASE zammad_production;
\connect zammad_production;
\i /var/lib/postgresql/data/20210513120754_zammad_db.psql
select table_name, column_name from information_schema.columns where table_schema=‘public’;
\q

  1. Copy bkp Files in
    /var/lib/docker/volumes/zammad-docker-compose_zammad-data/_data/

docker-compose exec zammad-backup bash
cd /
tar -xvzf /opt/zammad/20210513120754_zammad_files.tar.gz

  1. docker-compose stop; docker-compose start && docker-compose logs -f

But this way has a problem, as mentioned above:
users are not displayed:
http://1.2.3.4/#manage/users

Resolved like this:
7. zammad run rake searchindex:rebuild