The Problem of Copying Live Data
Of course, we recommend stopping Kerio MailServer while doing a data migration. Some companys cannot afford downtime for such a long operation.
What can go wrong and how do sysadmins handle it?
Linux or Mac OS X
The trick to this is to preserve the timestamps on the .eml files in the mailstore. This is critical for proper indexing. In UNIX, probably the most reliable way to move data is with a tar pipeline. Under the store directory is a folder called "mail". This is the email that must be migrated.
sudo bash cd /old/mail/store/mail mkdir -p /new/mail/store/mail tar cvpf - . | (cd /new/mail/store && tar xvpf - ) |
There are several things to note about these commands.
|
Disaster situation: Suppose your old hard drive is failing, and you cannot copy the data due to device timeouts or corrupt blocks in the filesystem. This might be a very dire situation, but it still might be possible to copy the data with the following command:
|
For Windows there are several options
Use cygwin. Install the cygwin tools, and use tar piplines such as the one in the UNIX section of this document.
mkdir -p /cygdrive/f/store/mail cd "/cygdrive/c/Program Files/Kerio/MailServer/store/mail/" tar cvpf - . --ignore-failed-read | (cd /cygdrive/f/store/mail && tar xvpf - ) |
The thing to notice with cygwin is that the drives are not specified the same way. The "C:" drive is specified by "/cygdrive/c" and similarly with the "F:" drive.
Use xcopy. Xcopy is a powerful command line tool similar to tar. It is executed as follows (assuming F:\store\mail does not exist yet):
C: cd \program files\kerio\mailserver\store\mail xcopy . F:\store\mail /SEIKO |
The switches are /SEIKO for recursive copy, include empty directories, create destination directory, preserve readonly and acl information. Modified timestamps on the individual files are preserved, but it seems timestamps on the directories are not. The tar using cygwin tools does preserve the modification times on the directories (which doesn't matter to my knowledge).
Use ZIP. ZIP preserves timestamps which is good, but is prone to failure if there are any glitches in your hardware. Failing drives or memory or filesystem damage can cause ZIP to fail. When zipping gigabytes of data, there is a higher chance of running into such a hardware failure. It is certainly a viable way to migrate data.
|
Disaster situation: Suppose your source hard drive is failing and read errors and timeouts prevent copying from success. There are several ways to approach this:
|