Closed jm3west closed 6 years ago
That‘s not the only place that contains Mailcow data. /var/lib/docker/aufs or /var/lib/docker/overlayfs contains the Docker images, but they can usually be retrieved again with docker-compose pull
, so most people don‘t back them up. /var/lib/docker/volumes contains all the user mailboxes, databases, etc., so you need to back that up too.
@jm3west For backup strategie, replace the tar-archive with an emashing tool like borg https://borgbackup.readthedocs.io
You need to backup the mounted volumes + your mailcow folder. If you will restore the entry same system, you should also backup the used images of mailcow-service.
Example script file to backup an docker-compose service volumes with (optinal) images. https://github.com/Siassei/docker-volume-backup/blob/master/docker_full_backup.sh
Usage: (note, it is dev-status. but a good entry point for your env)
MODE=backup # or restore
path=/opt/mydocker/project1/docker-compose.yml
project=project1
BACKUP_DIR=/tmp/mybackups
DATE=xxxx-xx-xx # with borg, that feature is not needed and currently sticked with x's
#export EXCLUDE_CONTAINER=1
#export EXCLUDE_VOLUMES=1
./docker_full_backup.sh $path $project $BACKUP_DIR $MODE $DATE
seems like these things add to the mailboxes and database:
but there is probably more. found this information in a pull request about a backup script
@mkuron thank you so these are the things mentioned in the pull requests:
I see two more docker volumes on my system:
Are these volumes holding anything important?
I could also imagine that a backup of the mailcow-dockerized
directory would be worth to be backed up.
--
general idea: would it be enough to just stop mailcow, make a copy of all volumes in /var/lib/docker/volumes/
, make a copy of the mailcow-dockerized
directory and then restart mailcow?
I wrote something for all important data, will push soon.
The backup script is now available in master.
Hi,
is it possible just compress (tar) the mailcow_dockerized complete folder and good is. When I have a problem then I do it uncompress the tar archive and the job goes on
Is this wrong?