I'm on mobile so a bit brief, but in addition to the actual mail messages an IMAP server assigns unique ID numbers to messages, which are more or less specific to that IMAP server.
By migrating you moved the existing mail but the IMAP server generates new unique ID's and mail clients see every old message as new. Tough luck :(
https://www.rfc-editor.org/rfc/rfc3501#section-2.3.1.1
2.3.1.1. Unique Identifier (UID) Message Attribute
A 32-bit value assigned to each message, which when used with the
unique identifier validity value (see below) forms a 64-bit value
that MUST NOT refer to any other message in the mailbox or any
subsequent mailbox with the same name forever. Unique identifiers
are assigned in a strictly ascending fashion in the mailbox; as each
message is added to the mailbox it is assigned a higher UID than the
message(s) which were added previously. Unlike message sequence
numbers, unique identifiers are not necessarily contiguous.
The unique identifier of a message MUST NOT change during the
session, and SHOULD NOT change between sessions. Any change of
unique identifiers between sessions MUST be detectable using the
UIDVALIDITY mechanism discussed below. Persistent unique identifiers....