move mailboxes and mark email as "read"

Duncan Gibb Duncan.Gibb at SiriusIT.co.uk
Fri Nov 20 11:02:51 EST 2009


Michael Menge wrote:

TV> I'll move several thousand cyrus mailboxes to a new server. Old
TV> Server was running cyrus imapd 2.2, new server runs cyrus imapd 2.3.

TV> I tar all users starting with A (later b,c,d..), create all
TV> mailboxes on the new server with cyradm (script), extract the
TV> tar file, reconstruct all mailboxes.

TV> The only problemI have, is "seen.db". On my new server, every email
TV> is marked as new, unread email. Is there a way to fix this?

MP> Dump to flat file, copy to new server, convert back to desired bd
MP> format.

MM> You should also dump the mailboxes.db and import it on the new server,
MM> this insures that the mailbox uid, which is used in the seen.db is
MM> consistent.

Another possibility is to use an rsync+reconstruct cycle to copy the
message content, then (possibly asynchronously with the user switchover)
use a scripted IMAP client like perl's Mail::IMAPClient to connect to
old and new systems and transfer the metadata (read all the message
flags, including "seen", on the source and set them on the target).

This allows you to phase the migration if you have a large volume of
data, and means you do not need to stick to the same namespace
conventions on the target server(s).  It also means you can redistribute
mailboxes across a Murder differently to how they were in the source
system(s).

However unless you can keep identical message UIDs at both ends it
doesn't scale well when you have folders containing very large numbers
of messages, because your script must either hold all flags for all
messages in memory, or keep doing search operations on one end or the
other to find the relevant message by some more expensive identifier.

Cheers


Duncan

-- 
Duncan Gibb - Technical Director
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk/ || t: +44 870 608 0063
Debian Cyrus Team - https://alioth.debian.org/projects/pkg-cyrus-imapd/


More information about the Info-cyrus mailing list