Thank you! A local installation of imapsync on the server did a great and fast job in transfering the emails from one account to the other.