On 15/07/2019 09:00 Mike via dovecot < dovecot@dovecot.org> wrote:
Hello,
I was forced to do an emergency server migration with about 3000mailboxes and I botched it somewhat. Hoping to find some help here.
My symptoms are, users showing apparently deleted mail messages, somereplicated mail, and a time period of mail that is just 'missing'.
The source server is centos 6.10 with dovecot 2.2.5, and the destinationis ubuntu 16 / dovecot 2.2.22. User mailboxes are mdbox format and I didan rsync from the old to the new. My screw up however was that my rsyncwas not --delete files, and had to be run multiple times over the courseof a few weeks due to to bandwidth disparities and the sheer size of themail spool approaching 700GB (source server had 10mbps. Should have usedsneakernet instead). The bottom line however is that I wound up havingmany extra m.* files in each user storage dir that were not actuallypresent on the source when the final, final sync was made and I wentlive with the migration server. I know this is my fsckup but now I haveto deal with it.
I first tried to fix the symptoms with a force-resync on the boxes notrealizing the above, and that seemed to make things worse by onlyshowing new mail as of the server migration date. Ugh.
New mail is being delivered and this does appear in user mail boxes. Butas I said, there seems to be some users with a problem with old mailpresumably deleted on the prior server suddenly re-appearing (probblydue to the extraneous m.* mdbox files present). A more pressing problemis that there is simply a time period of mail that is in user mailboxes(on the old server) from before the migration, which is not displayingnow for these users on the new server.
I have investigated this and hacked on "mdbox-recover.pl" somewhat sothat it iterates over all mdbox files for a user and I can extract ALLmessages, and see that, yes, the mail really is present in the mdboxfiles, but pop/imap never shows it. This is puzzling to me. I have atest user that when I check imap, it shows only 21 message in inbox and1 in sent. But if I extract the messages from the mdbox files, then Iactually have 1117 messages.
I know I can't just rsync the source server again with the right--delete flag, there has been lots of mail deliveries to the migratedboxes and so I don't want to lose all of that and create yet moreproblems. But I need to find some way to make these present mailmessages appear for my users again. Im thinking it's got to be a flag ofsome kind since the data is there it's just ignored. Wondering what youwould reccomend?
Thanks.
Mike-
Try with one mailbox first.
Delete dovecot.index.map files and run force-resync.
--- Aki Tuomi