Conversion/Migration

John Alton Tamplin jtampli at sph.emory.edu
Tue Jan 28 18:06:21 EST 2003


Peter Lawler wrote:

> OK, thanks to those who replied. I've gone this far:
> http://batleth.sapienti-sat.org/projects/mb2md/
>
> It's a pretty neato script, although I haven't tested the version 
> released yesterday. It converts just as we want.
>
> Now, the trick after the conversion that the new files are in, say 
> ~/Maildir/new/, so that they need to get moved into the cyrus store 
> for the user. That's no problem. However....
>
> I've got stuck at the next bit. OK, I can work out that the messages 
> in the INBOX are individually numbered (eg, 52., 53., 54.). So, the 
> converted mail files need to be renamed, one would guess. Can someone 
> suggest the best method for renaming these files? Is the order of 
> numbering of the files important (eg, datestamping), or is it irrelevant.
>
> Next thing is that only occasionally have I been able to rebuild the 
> cyrus DB to have these converted messages appear in the INBOX. It was 
> late last night, so I can't recall ALL the details. However, I do 
> suspect that it *MAY* have something to do with the naming of the 
> files mentioned above. Additionally, it *COULD* have something to do 
> with the cyrus commands I'm issuing to try and rebuild the cyrus DB.
>
> Thirdly, when (on only two occasions, mind you) the converted messages 
> did pop up, they are being displayed as 'read'. How can I set their 
> status to 'unread'. I did suspect that *MAYBE* the fullstop (period) 
> at the end of the filename might be the clue, but since I didn't 
> manage to get the messages appearing again, I could work it out.
>
> Any comments, suggestions, flames, greatly appreciated.

I think you would be much better off going through IMAP rather than 
trying to put the files in there correctly and then reconstructing it. 
 You won't be able to maintain seen state (or any other flags for that 
matter) unless you build all the cyrus files correctly during the 
conversion.  If you use mbxcvt from UW imap-utils, it will preserve the 
flags as part of the transfer.  The only catch is you will have to be 
able to authenticate as the user when you convert.  What I did was a 
temporary hack to saslauthd which allowed a backdoor password to work 
for all accounts and hacked mbxcvt to accept the password on the command 
line (no user accounts on this machine to watch ps).  A wrapper script 
went through all the accounts to transfer (one by one) and updated the 
database used by perdition (imap/pop proxy) to show the account was 
being used and killed all active sessions.  It then converted each 
mailbox using the hacked mbxcvt, connected as the admin account to set 
the quota, and connected as the user to set the subscription list.  When 
the account was moved, update the perdition database so new connections 
go to the new server (and LMTP deliveries via proxy) and go to the next 
one.  If you don't need to do the transfer while everything is up, 
obviously you don't have to fool with the database for the proxies.

-- 
John A. Tamplin                               Unix System Administrator
Emory University, School of Public Health     +1 404/727-9931







More information about the Info-cyrus mailing list