Backup_core_only on email?

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.1.39
How are you able to access your server: The webadmin
SSH

Describe your issue

Hi everyone,

I’m looking for some advice regarding backup strategy for the mail stack on YunoHost.

Right now, I’m using the yunohost backup CLI and overall I really appreciate how simple and reliable the restore process is. For applications like Nextcloud, I take advantage of options like backup_core_only and handle user data separately with incremental backups. This gives me a good balance between backup size, frequency, and restore simplicity.

However, I’m running into an issue with email: my users’ mailboxes are growing quite large, and backing up data_mail every time is becoming increasingly heavy and inefficient.

What I would ideally like to achieve is something along these lines:

  • Keep using yunohost backup for system consistency and easy restores
  • Backup only the mail configuration (Postfix, Dovecot, etc.) via YunoHost
  • Handle mailbox data separately using incremental backups (e.g., rsync, borg, restic, etc.), similar to what I do for Nextcloud data

From what I understand, the mail system is treated as a monolithic “system part” in YunoHost, so there’s no built-in way to separate config from data in backups.

Another goal is to avoid needing a disk with roughly double the required capacity just to generate the backup archive locally before transferring it elsewhere.

So my questions are:

  • How are you handling backups for large mailboxes?
  • Do you exclude data_mail entirely from YunoHost backups?
  • If so, how do you ensure reliable and simple restores?
  • Are you backing up /etc/postfix, /etc/dovecot, etc. manually?
  • Any recommended tooling or best practices for incremental IMAP/maildir backups?

Thanks!

Share relevant logs or error messages

NO

1 Like

Hi,
Why do you say “mail system is treated as a monolithic system part”?

BACKUP_CORE_ONLY=1 yunohost backup create --system data_mail --dry-run
Info : /var/mail will not be saved, because 'BACKUP_CORE_ONLY' is set.
size: 1174
size_details: 
  apps: 
  system: 
    data_mail: 0

yunohost backup create --system data_mail --dry-run
size: 4936749471
size_details: 
  apps: 
  system: 
    data_mail: 4936744119

BACKUP_CORE_ONLY=1 is supported with data_mail

How are you handling backups for large mailboxes?
With Borg, deduplication avoid backup datas already backup in the previous backups.
Do you exclude data_mail entirely from YunoHost backups?
No, but /var/mail is not big in my case, only 4,9 Go. I do multiples backups, mails, nextcloud, system, etc… Mails are backup 4 times by day because it changes more often than the others data (and is more sensible too)
If so, how do you ensure reliable and simple restores?
With yunohost tools. borg export-tar to export as tar before restore with yunohost. Or simply mount the Borg archive and restore by copy/paste what i need.
Are you backing up /etc/postfix, /etc/dovecot, etc. manually?
No but i backup some files/folders with /etc/yunohost/hooks.d/backup/99-conf_custom. You can use it to backup /etc/postfix, /etc/dovecot but i don’t think it is usefull in that case as there is native command and BACKUP_CORE_ONLY.
Any recommended tooling or best practices for incremental IMAP/maildir backups?
Borg gives me satisfaction - i use it for several years.

Thanks, that’s very helpful — I didn’t realize BACKUP_CORE_ONLY=1 was also supported for data_mail, that actually answers a big part of my question.

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