Artica Wiki

Moving the mailbox store to another disk

Move the Cyrus mailbox store to another disk from the console, without losing mail.

The Cyrus mail store holds every message on the appliance. 
It starts on the system disk, which is sized for the operating system rather than for years of mail, so a busy server eventually fills its root filesystem — and a full root filesystem stops far more than mail.

This page describes how to move that store onto another disk from the console, without losing a single message and without hand-editing any configuration file.

When you need this

Before you start

Moving the store

The destination directory does not have to exist yet — if its parent does, the appliance creates it with the right ownership. 
What it will refuse is a path whose parent is missing, which is almost always a typo.

What happens while the move runs

The mail service is stopped for the whole operation. That is deliberate, and it is what makes the move safe:

Users with an open mail client will see it disconnect and reconnect. 
Sent mail queued in their client will go out once the service is back.

How long it takes depends almost entirely on the destination disk. 
As a rough guide, a store of a few gigabytes moves in minutes.

After the move

The status page shows the new location, and the appliance is already using it — new mail is delivered to the new disk immediately.

The old store is deliberately left in place. Nothing is deleted for you, so the operation stays reversible while you satisfy yourself that everything is intact: check that mail is arriving, that clients connect, and that folder contents look right. Once you are confident, an administrator can remove the old directory from the shell to reclaim the space. Until then, note that the root filesystem has not gained any room yet — the space is only freed when the old copy is removed.

If something goes wrong

Every failure leaves the appliance on the original store, with the mail service restarted. You lose time, never mail.

The destination is not empty Give an empty directory. 
Merging two stores would leave no way to tell afterwards which files belonged to which.
The destination directory does not exist Its parent is missing too. 
Check the path, and check that the disk is actually mounted.
The destination is inside the current store A directory cannot be copied into itself. 
Choose a path on the other filesystem.
Not enough free space The destination needs the current size plus a margin. 
Check the figure shown in the dialog.
The copy is incomplete The copy was interrupted or the destination filled up. 
The service was restarted on the original store; free some room and try again.
The data was moved but the mail service did not restart The move itself succeeded and the configuration points at the new store. 
Investigate the service state on the status page — do not move the data back.

Good to know