if you use mdbox, you should use doveadm backup and not rsync. With rsync there is a risk that the index will break, it can't simply be rebuilt.
For mbox / mdbox / mailDir you can use this command:
doveadm backup -u user1 mdbox:/home/backup/user1/
The command explained:
doveadm backup -u user1
dsync backup -u user1
That two varaints do the same: you call the doveadm and tell it, you would like to a backup for all mails from user1. Doveadm take the information about the mail location from the variable "mail_location" from the dovecot config.
This part regulates the target backup mail-format, in my case: mdbox => if you want, your backups schould stored as mailDir you use:
If you use mdbox, you are able to use live compression: