Hi,
Please follow official docs:
What you need to know about migrating your IMAP mailboxes to Microsoft 365 or Office 365
Migrate other types of IMAP mailboxes to Microsoft 365 or Office 365
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.