To transfer mail from one IMAP server to another IMAP server, you should use
eSoftTools IMAP Backup & Migration software. This software keeps all the data intact, making the migration process easier. Also, it allows to safely extract and save IMAP account emails in various file formats like- PST, MSG, HTML, MHTML, EML, EMLX, MBOX, etc. Try its free demo now to know more features of this software.
Read more- Migrate IMAP email to new server