# Backup\_core\_only on email?

**URL:** <https://forum.yunohost.org/t/backup-core-only-on-email/42048>\
**Category:** Support\
**Tags:** mail, backup, english\
**Created:** [April 12, 2026, 8:33am UTC](https://forum.yunohost.org/t/backup-core-only-on-email/42048 "2026-04-12T08:33:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rungeard](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rungeard/32/4371_2.png) [@rungeard](https://forum.yunohost.org/u/rungeard)\
**Post date:** [April 12, 2026, 8:33am UTC](https://forum.yunohost.org/t/backup-core-only-on-email/42048/1 "2026-04-12T08:33:30Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![metyun](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@metyun](https://forum.yunohost.org/u/metyun)\
**Post date:** [April 12, 2026, 12:49pm UTC](https://forum.yunohost.org/t/backup-core-only-on-email/42048/2 "2026-04-12T12:49:14Z")

</div>

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

```auto
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

```

```auto
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.

---

<div class="post-metadata">

**Author:** ![rungeard](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rungeard/32/4371_2.png) [@rungeard](https://forum.yunohost.org/u/rungeard)\
**Post date:** [April 12, 2026, 2:44pm UTC](https://forum.yunohost.org/t/backup-core-only-on-email/42048/3 "2026-04-12T14:44:09Z")

</div>

> [@metyun](#):
>
> BACKUP\_CORE\_ONLY=1 is supported with data\_mail

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.

---

<div class="post-metadata">

**Author:** ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)\
**Post date:** [May 12, 2026, 2:44pm UTC](https://forum.yunohost.org/t/backup-core-only-on-email/42048/4 "2026-05-12T14:44:41Z")

</div>

Closed on May 12, 2026, 2:44pm UTC

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