I remember a couple of years ago i migrated my mailboxes to a new machine when i upgraded my hardware.
I don't know the exact steps anymore, but the steps outlined at the following article looks similar and may be helpful:
viktorpetersson.com/2010/10/03/moving-cy...t-to-a-64bit-server/
Although i haven't tried this myself yet, this tool also looks interesting:
http://sourceforge.net/project/shownotes.php?release_id=52353
As i'm currently also trying to figure out how to upgrade from 5.2 to 6.x i will probably use one of above.
If i really have enough time to perform the upgrade i will post the results here.
Good luck!