Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a mail server running Debian 5.0. It is one year old now but we want to deploy a new server with Ubuntu Server 10.04. The problem is that we want to transfer all the user mails and settings to the new mail-serverl. So all their usernames and passwords should be the same, all their mails should be transferred successfully to the new mail server. In the old mail server we are using Squirrel Mail as frontend, but in the new mail server we are planning to use Round Cube.

How can we achieve this, I am looking for some detailed tutorial or guide to do this and haven't found any on google. Is it possible to do this ?


I am using postfix, dovecot and mbox on the older server and User accounts are stored in /home directory and there is another /home/username/mail directory where the mails are being stored. Please tell me what more information you need and I will provide it. I am using Debian 5 on older server and will be using Ubuntu 10.04 on the newer server. I am planning to use MailDIR instead of Mbox, but if that does not work, I will use Mbox on the newer server too, I just want to transfer everything to the newer server.

share|improve this question
1  
It's impossible to answer this question without knowing more about your environment. We can't even make assumptions from the tags because you listed two mailbox types, maildir and mbox. Provide me with details like what smtpd, where user accounts are saved, and some more details and then you can get an answer. –  sandroid Aug 19 '11 at 14:28
    
I am using postfix, dovecot and mbox on the older server and User accounts are stored in /home directory and there is another /home/username/mail directory when the mails are being stored. Please tell me what more information you need and I will provide it. I am using Debian 5 on older server and will be using Ubuntu 10.04 on the newer server. I am planning to use MailDIR instead of Mbox, but if that does not work, I will use Mbox on the newer server too, I just want to transfer everything to the newer server. –  Harbhag Aug 19 '11 at 18:50

2 Answers 2

up vote 1 down vote accepted

Thanks for clarifying on what the environment is. If you're running postfix/dovecot with unix users is actually pretty straightforward. Follow this guide to transfer over user accounts from an old unix server to the new one:

http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/

This will cover moving your actual user accounts and groups, as well as the passwords, and if you adapt some of the generalisations there, you can move your mail over too. It mentions /var/spool/mail but you've already got it covered with /home/username/mail, which is in your /home which you should copy.

Now, in order to convert your mbox mail to Maildir, you need to run this perl script, linked here, to convert. Make sure you keep a backup of the originals before doing this. I had this in my bookmarks, but I've never had to use it:

http://www.qmail.org/convert-and-create

The other changes will be to your configs to adapt them to using maildir and not mailbox, but that should be straightforward.

share|improve this answer

Once the new server is configured

Copy the old /etc/passwd & /etc/shadow & /etc/group (i'd recommend copying just the entries over 500)

then copy the data to the new server ( I recommend rsync, and save the script you will need it)

copy the relevant config files (backing up the old ones) for the mail server

test, fix, test, etc

Once it's working properly

stop incoming mail on the new server

stop incoming mail on the old server

use rsync again to get the changes in files, check to see if any passwords were changed, by comparing the entries in /etc/shadow

move the IP of the old mail server to something temp

move the new server over to the old address

start incoming mail on the new server

share|improve this answer
1  
This does not work when the passwords are not UNIX accounts but virtual users. It may even break the mail storage. And it won't work if the mails are in a database. And so on... –  mailq Aug 19 '11 at 15:24
    
Correct, however just copying the information over should not break anything but the new server. If there configs & mail are stored in a database then the procedure is similar, and can be tested. –  tkrabec Aug 19 '11 at 15:27
    
Configuration copy only works (well) if the software and the version don't differ. This type of question is like "I want to move to somewhere else. How can I do that?" and not telling overseas, with familiy, by car, ... –  mailq Aug 19 '11 at 15:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.