Hi
if you want migrate dirsync to entra connect you don’t need to cleanup immutableID.
immutableID is calculated based on msds-consistencyGuid in on premise AD. Since the value of msds-consistencyGUid will not be modified during the upgrade to entra connect , you don’t need to cleanup immutableID and the hard match will be able to relink entra ID account with on premise AD account.
I invite you to read the following link for details about the migration from Dirsync to entra connect server:
https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-dirsync-upgrade-get-started
Please don’t forget to accept helpful answer