You could use imapsync for transferring the accounts. If you have a VPS running somewhere that would speed up transfer and you don't have to keep your local pc running.
Usage is quite simple: imapsync --host1 imap.truc.org --user1 foo --password1 secret1 --host2 imap.trac.org --user2 bar --password2 secret2
