How to Restore Zammad Backup in Docker-Compose Install

I’d like to restore a Zammad backup on a Docker-Compose install.

I can’t find steps in the documents to do this correctly.

I’ve made a backup from my old DEB package install on Debian 9. Now I would like to restore into a brand new Docker-Compose install.

I can’t find step by step instructions to do this correctly. Here are some of my questions:

  • Should I copy backup files to one of the docker containers and restore from there?
  • Which docker container should I copy to and restore from?
  • Is there a command I should issue to stop Zammad before restoring?

Thanks for the help!

Hey,

I honestly don’t know too much about Docker right now.
I don’t know much on how the Docker image runs, before hand a small warning: We currently do not support docker images in productive.

Any way, this documentation might help you, it might be possible that you can just stop the zammad service like in a normal installation:
https://docs.zammad.org/en/latest/install-source.html

If so, please ensure that your source Zammad installation does not use a MySQL database because if it does, you’ll need to convert the dump before hand (our provided scripts don’t do that for you).

You can find information about the script here:
https://docs.zammad.org/en/latest/appendix-backup-and-restore.html

Simple backup, get the backup file to your docker system and restore ist there should work fine.
Stopping Zammad during that process is a good idea to ensure know data is being changed.

I hope that helps, Feedback is welcome. :slight_smile:

Thanks so much for the help.

The backup was so easy with a DEB package install but after a little digging I figured out how to backup and restore with a Docker-Compose install of Zammad.

Backup Zammad with Docker-Compose

I found that a container has been built especially for the purpose of backing up although it’s not very well documented there is a discussion about it here.

I’m not sure if I should be stopping containers to prevent data changing as I backup. I tried stopping all containers apart from zammad-backup and zammad-postgresql but without zammad-railserver running backup will not work. Any best practices here would be very welcome as feedback.

Here’s the command to initiate backup:

docker-compose exec zammad-backup /usr/local/bin/backup.sh zammad-backup-once

You can also initiate a backup of the database only using:

docker-compose exec zammad-backup /usr/local/bin/backup.sh zammad-backup-db

It seems the zammad-backup container runs automated backups every so often but I’ve not worked out the frequency yet.

Backups are available at this location:

/var/lib/docker/volumes/zammad-docker-compose_zammad-backup/_data

Restore Zammad with Docker-Compose

Restore instructions documented here worked perfectly for me.

Conclusion

This isn’t the way to do backup and restore with Docker-Compose but it’s a way. Please feel free to feedback if there are better ways to do this. Thank you for the great work you do on Zammad - I love it!

1 Like

Exactly. (I also have not worked out the frequency and/or occasions.)
Then, I have those backups synced to my local DiskStation (Synology NAS), which works like a charm! :slight_smile:

It seems to backup once every 24 hours but the timer starts after your last backup finished.

This means if a backup begins at 7am, takes one hour and then completes at 8am your next backup will start at 8am the next day.

Every time the container is restarted it will also initiate an immediate backup. This has been my experience.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.