• Ttobiasf

      Moolevel 1
    • Edited

    Hello,

    does anybody have experience to backup mailcow by from docker host to a Proxmox Backup Server by using the agent “proxmox-backup-client? Do not confuse my question with a backup of a complete VM running on Proxmox VE.

    I moved my mail server from a local hosted VM to a VM in the cloud. By doing so I loose the backup functionality of my local hypervisor. Running a backup with the mailcow backup script backup_and_restore.sh to another host is running fine and also recovery is working. Unfortunately here I am missing the incremental backup feature. The vmail file is too big for full backups.

    I could follow the manual and up Borgmatic Backup to get the incremental backup functionality. As I already run a Proxmox Backup Server I would like to go this way by using the proxmox-backup-client running on the docker host running mailcow.

    My concept:

    Create a temporarily local backup on the docker host running mailcow by the mailcow backup script for everything but vmail to get proper dumps of the databases:

    export MAILCOW_BACKUP_LOCATION='/opt/mailcow-backup-local'
    /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup crypt redis rspamd postfix mysql --delete-days 3

    Backup this local backup, the relevant folders on the docker host and the docker volumes to the Proxmox Backup Server using the Proxmox backup client.

    export PBS_PASSWORD='xyz'
    export PBS_USER_STRING='mailcow@pbs!mailcow-token'
    export PBS_SERVER='pbs.domain.tdl'
    export PBS_FINGERPRINT='xyz'
    export PBS_DATASTORE='pbs-datastore'
    export PBS_NAMESPACE='mailcow'
    export PBS_REPOSITORY="${PBS_USER_STRING}@${PBS_SERVER}:${PBS_DATASTORE}"
    export PBS_HOSTNAME="$(hostname -s)"

    proxmox-backup-client backup \
    etc.pxar:/etc \
    root.pxar:/root \
    home.pxar:/home \
    mailcow-backup-local.pxar:/opt/mailcow-backup-local \
    mailcow-dockerized.pxar:/opt/mailcow-dockerized \
    volumes.pxar:/var/lib/docker/volumes \
    --ns ${PBS_NAMESPACE} --skip-lost-and-found

    Any thoughts on this?

    Due to combining the the the mailcow backup scripts with a backup of all volumes I do have redundant data. But because of missing experience in backing up the volumes only this will be the save side. My main goal is to get incremental backups of vmail.

    I think one way to get a good incremetal backup from Mailcow is Borgmatic. I use PBS for several other things but no experience with Mailcow.

      Have something to say?

      Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

      Ganzjahresgriller

      Yes, Borgmatic is one way that works and that is well documented, as mentioned in my post. I believe there are many people with experience. But I am asking, if someone has experience in Proxmox Backup Server.

      I am already running Proxmox Backup Server and Veeam B&R with overlapping scope. I do not want to add a third backup solution. Veeam B&R is verry good if it comes to backup of complete machines and guest aware processing of supported applications. I believe it is not the best choice for an Docker host. Therefore I started with Proxmox Backup Server on file level base.

      4 days later

      Hi tobiasf,
      I went through a similar process and currently have my personal mailcow on a VPS. I use mailcow’s very own create_cold_standby.sh script to update a dedicated VM at my desired frequency on my proxmox at home.
      This VM is then backed up to my PBS with a retention schedule to suits my needs.
      I also run on the VPS, but less frequently the proxmox-backup-client to create copies of the VPS directly to my PBS, but I exclude the /var/lib/docker folder as mounted volumes cause errors with the backup client, to store all settings and states of the VPS.

      Say, in case of unexpected turn of events, the VPS disappears in a disaster, I can simply activate the cold copy on my proxmox and redirect the DNS entries to it and be back in business. Or just start with a fresh VPS, restore the last backup with the proxmox-backup-client and use the create_cold-standby.sh on the VM to copy it back the standby copy to the fresh VPS and start that.

      May not be the best plan doing it this way, but works for me. Some caveats, the disk space use will be more, since you keep a VM, and separate objects on PBS, created by your proxmox server backup and proxmox_backup_client, but deduplication make wonders. The create_cold_standby.sh only works on unmodified mailcow installs, which is OK for me, extra.conf settings not an issue, but I you tweaked your containers and running many extra containers, more likely an issue.

      Hope this is useful, cheers, Lleo19

      The create_cold_standby.sh script would make my issue worse in comparison to using the backup_and_restore.sh script. Backups are getting too big if I want to let it run on hourly base. But yes, I guess in combination with Proxmox Backup Client or Borgmatic I could do incremental backups in the same way I described in my original post.

      For fast disaster recovery, your strategy looks good to me. For me this is not the highest priority. Along with my domain name there comes a little web space and mail space where I have set up all mail accounts. Just a hand full. I just need to change the DNS not to lose new mails and could re-create the mail server without time pressure. For me the priority is to backup the already received mails on a frequent base.

      Sorry, it was not clear where your bottleneck or limitation is.

      My bottle neck is that vmail is “too big” to just let run and transfer a full backup without incremental on a frequent base. Both backup scripts reate_cold_standby.sh and script backup_and_restore.sh are doing this. The solution in the manual using Borkmatic is more clever. My solution with Proxmox Backup I would see on the same level by theory but I have no experience.

      The create_cold_standby.sh script uses rsync and that only transfers what is new in the docker volumes. So it is kind-of-incremental, not a full copy (except on the first run of course)
      My vmail volume is about 20GB total. The create_cold_standby.sh script runs and finishes in about 30 seconds on top of each hour to update the VM on my proxmox. I trigger a snapshot of the VM on the bottom of each hour to my PBS, and replicate that further daily as needed.
      My limitation is the VPS disk space and memory. In fact, I could not make a local copy as it would not fit on the disk.
      Of course, creating a single tar.bz2 file of your vmail volume and archiving it is too big, and that is clear that you will want to use a tool that would do incremental backups of your local, for which there are several options. If your VPS has the memory and CPU capacity for the extra work to do the archiving and de-duplication on the server, then great! I do not have that available on the VPS, but I do locally, that is why suggested the create_cold_standby.sh which creates matching and consistent copies.
      Many will argue that the hourly backup is not enough as you could loose anything received since last run, up to an hour worth of email… mailcow is ready to send copies of emails accepted to another server, but this is another topic altogether.

      The create_cold_standby.sh script uses rsync and that only transfers what is new in the docker volumes.

      Thank you!
      This I have overseen when checking the manual.

      No one is typing