Transferring mails and user setting to new mail server

view story

http://serverfault.com – 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. I (HowTos)