Benjamin Podszun
2014-Apr-04 07:52 UTC
[Dovecot] dsync deleted my mailbox - what did I do wrong?
Hi. Mostly annoying: I migrated from one machine to another, made sure the target host worked as expected, updated mx records and - after a couple of days - signed it off as good. This is just my private machine, no big deal if something goes wrong.. Everything's fine? Good, let's migrate my inbox from the old machine. There's no direct connectivity between those servers, so what I did was: (old server) sudo -u vmail dsync -u dar at darklajid.de backup maildir:/tmp/mail_backup/ Works fine, got my maildir. Tar'd it up, moved it to the new server. Now how do I import those mails? Ah, let's use the same command, with -R? (new server) sudo -u vmail dsync -u dar at darklajid.de -R backup maildir:/tmp/mail_backup Error: Mailbox INBOX sync: mailbox_delete failed: INBOX can't be deleted. Wait. What? Sure enough, the last couple of days are gone, the target mailbox is completely empty. I read the man page over and over again, but failed to see the problem. I even thought for a moment that _maybe_ dsync backup is one-way only (even if that failed as well) and tried the same command with mirror. Exactly the same output, same result, empty target mailbox. In the end I succeeded to import the mails with doveadm import, completely lost a number of days of mails. My fault, sloppy not to back the up again, but I still don't think that this should happen. Ever. My question now is: - where did I fail (ignoring the backups, please. That's .. something I know) - Can I use dsync ... for backups? I don't think that this is a good idea after yesterday night? - Should dsync EVER try to delete mailboxes? Even 'special' mailboxes? Should it warn about that, asking for a --force switch or something? Any insights would be appreciated. At this point the damage is done, but I'd like to learn how to do better. Ben
Jiri Bourek
2014-Apr-04 14:48 UTC
[Dovecot] dsync deleted my mailbox - what did I do wrong?
Hi> > - where did I fail (ignoring the backups, please. That's .. something I > know)From the man page: "backup - Backup mails from default mail location to location2 (or vice versa, if -R parameter is given). No changes are ever done to the source location. Any changes done in destination are discarded." The last sentence describes what happened to you: all new mail on the new machine is a "change" and was discarded (by deleting new mail.) If I'm not mistaken, this is correct behaviour for backup mode - you get exact copy of the source side (maildir:/tmp/mail_backup) on destination side (dar at darklajid.de)> > - Can I use dsync ... for backups? I don't think that this is a good > idea after yesterday night?AFAIK you can safely use it to make the backup. I'm not sure if it can be reliably used to restore data (don't think so but I'm not an expert.) I'd use doveadm import for that.
Possibly Parallel Threads
- Rsync --update copy one file multiples times
- Trouble with rsync inside fcron: buffer overflow in recv_exclude_list
- Does dsync handle client-side deletions?
- Significance of interaction depends on factor reference level - lmer/AIC model averaging
- LMTP during dsync migration