Moving the Cyrus Mailstore

Scott Adkins adkinss at
Mon Oct 23 12:38:59 EDT 2006

Another option is to get the physical partition created and setup and then
create a "cyrus partition" on that and migrate the users to it via the server
itself, as opposed to doing it physically.  The moves are transparent and
does not require you to down the server.

Here are a couple of suggestions:

  1) Let's say you create a /home/cyrus physical partition (filesystem).
     I suggest that you then create additional "cyrus partitions" within
     that, since dealing with a smaller set of users is better, and it
     allows you to possibly moves some of these "cyrus partitions" to a
     physical filesystem or disk at some point down the road if you find
     that is necessary.  It may be better for backups too, since you can
     seperate the backups into smaller jobs (one failure doesn't mean a
     failure for all of cyrus, but just a smaller subset of cyrus).

  2) So, let's say you choose 26 cyrus partitions.  They could be located
     as /home/cyrus/a through /home/cyrus/b.  You need to reflect these
     partitions in the /etc/imapd.conf file:

        # default directory
        defaultpartition: default
        partition-default: /var/spool/imap

        # the new partitions
        partition-a: /home/cyrus/a
        partition-b: /home/cyrus/b
        partition-c: /home/cyrus/c
        partition-z: /home/cyrus/z

     Note: The "partition-a" through "partition-z" is what actually gets
     stored in your mailboxes.db file.  You can change the physical location
     of the partition at any point by modifying your imapd.conf file.  As
     long as you don't change the name of the partition itself, you don't
     need to worry about the user account in mailboxes.db

  3) You need to make sure your imapd.conf file also allows you to rename
     user accounts... This is done with the following:

        allowusermoves: yes

     Now, the nice thing is that you can essentially rename a user from one
     partition (defaultpartition) to the new partition (partition-X).  The
     Cyrus server will take care of the rest automatically.

  4) You can use the cyradm command to rename the mailbox, as follows:

        renamemailbox user.adkinss user.adkinss partition-a

It is recommended that the users you are moving are not logged in at the time
their accounts are being moved.  The easiest way to determine that is to look
at the /var/imap/proc directory to see if their userid appears anywhere in
the list.  This would catch shared folders as well.  Doing the moves in small
subsets, such as by letters of the alphabet, allows you to move things only
in the middle of the night (when there is less usage), advertise to the
community that maintenance for that subet of users will occur, etc etc.

This is the method we used when we migrated from 4 partitions (default, staff,
faculty and students) to the 27 we have now (default, a-z).

Anyways, just throwing out another suggestion for you.

Oh, by the way, I believe you can add or make certain kinds of changes to the
imapd.conf file and then send a signal to the master server to reread the
config file.  This might be an option for getting the new partitions into the
configuration without having to down your IMAP server.  The UNIX side of the
work (creating a new filesystem) shoulnd't require any outages either, unless
you have to down the server to add a new physical disk or something.

Good luck!

--On Friday, October 20, 2006 11:30 AM -0600 "Wickham, Larry" <Larry.Wickham at> wrote:

> Hi,
> Our server is suffering from impending doom, while servicing 11,500 users.
> Our mail store is in the default location under /var/spool/imap. The
> partition that / (/var is under here in our setup) is mounted on is 25 GB
> and I would like to move it to the partition where /home is mounted which
> has 1+ TB available. We have considered several solutions. The chosen
> solution would have minimal downtime and minimal chance of failure.
> 1) Repartitioning:
> Down the server and boot from a rescue platform. Backup and Resize /home.
> Create a new partition in the free space formerly occupied by /home. Copy
> /var to the new partition. Rename the existing /var. Edit fstab and boot.
> 2) Swaping mount points:
> Down the server and boot from a rescue platform. Move the contents of /home
> to a folder on the smaller drive. Copy /var to the larger drive. Modify
> fstab.
> 3) Migrating between mail stores
> Create a new mail store under /home and migrate the mail boxes? Not sure how
> or if we can do this.
> Please let me know your opinion on these solutions and any new suggestions
> are welcome and appreciated.
> Larry Wickham
> larry.wickham at
> Systems Operations Specialist
> Eastern New Mexico University
> 1500 S. Ave K
> Portales, NM 88130
> ----
> Cyrus Home Page:
> Cyrus Wiki/FAQ:
> List Archives/Info:

      Scott W. Adkins      
   UNIX Systems Engineer                  mailto:adkinss at
        ICQ 7626282                 Work (740)593-9478 Fax (740)593-1944
     PGP Public Key available at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
Url :

More information about the Info-cyrus mailing list