Old server- MBOX new server MDIR Should I?

nerdzoll

Well-Known Member
Oct 4, 2004
105
0
166
Hi Guys,
I have around 5 clients who I am migrating to a new server and I am decomissionning the old server.
However a couple of these clients have rather large (2GB+) MBOX Imap directories.

I am thinking this would be a good time to upgrade them to MDIR. However I am wondering, if i set the new server to use MDIR, when I import a cpanel backup will it automatically upgrade the email directories from the old mbox to mdir format. And will ALL the mail come across or is there a chance I might lose some?

Or is there a better way to do this?
Regards
Stuart
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Yes, when restoring cpmove backups, the new server will automatically convert any
mbox mailbox files to maildir mail folders and corresponding message files.

If the new server is much faster than the old server, I'd wait to do the conversion
until after the accounts have been moved to the new server and let the new
server do all the converting with better performance.

If there isn't much difference between the server speeds then I would probably
convert the old server to maildir before moving the accounts to make things easy.

To answer your question though, the restore backup function does convert mail
while restoring the backup if you want to just to do it at that time.
 

nerdzoll

Well-Known Member
Oct 4, 2004
105
0
166
Heya

Hi Spiral,
Thanks very much for that.
Oddly enough the new server is actually lower spec (slower cpu) to save money, nowhere near as many people being hosted on it. However as it happens I will probably convert them on there anyway as the speed difference is negligible.

Is there any chance of email loss doing this? And last question, if I set the server to use MDIR and the backup restore fails, can I change it back, and reload the backup with MBOX (lol yes I am paranoied, I just like my options open).
Cheers
Stuart
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
If you restore an account that was using mbox to a server with maildir and it isn't converted you can simply run:

/scripts/convert2maildir

and there's an option to redo the convert on any mbox files. You shouldn't lose any email using that method.
 

vishwas

Well-Known Member
Feb 9, 2004
61
0
156
Front of PC
One query

Hello,,

I dont want to convert all clients mails into maildir is it possible to convert only specific user.

-Regards,
 

sparek-3

Well-Known Member
Aug 10, 2002
2,173
280
388
cPanel Access Level
Root Administrator
Hello,,

I dont want to convert all clients mails into maildir is it possible to convert only specific user.

-Regards,
No. This is because mbox and maildir use different storage methodologies. Exim (MTA) and your POP server (cppop or courier) need to be able to understand these different storage methods.

The mbox format stores messages in a single file for a mailbox. The maildir format stores files into a specific directory, each message as its own file. The MTA needs to know how to write these files. When mail for domain.com arrives at the server and is delivered to that individual account, does it open a single mbox file or does it create a new file in the mail directory? If you have some accounts as maildir and some accounts as mbox, then the MTA would not know. I suppose you could patch or make special configuration for Exim to handle mail in a particular way based on the domain name that the message is being sent to. But generally speaking, the MTA needs to handle all incoming messages the same.

The same is also true for the POP3 server (and the IMAP server for that matter). When you connect to the POP3 server, how does it handle the reading of mail? If the set up is maildir then it would read individual files in a specific directory, if its mbox it would read one single file. The cppop server will not read maildir formats (I don't think). Systems that use maildir use Courier as the POP3 server because it can read maildirs. Again, I suppose you could patch the Courier program to act differently based on certain domain names, but you would have to compile Courier yourself and this really goes beyond the scope of cPanel.

So basically, the entire system needs to be one or the other. It either needs to be a mbox system or a maildir system so that the MTA and POP3/IMAP servers can act accordingly.