Problem statement
We have a custom database connection and we have decided to turn Import Mode on. Is there a way to search if a user has been migrated from a custom database connection that has import mode on?
Solution
If you have been using a Custom Database in a legacy mode previously, Auth0 will have a user record for users already even if they haven’t migrated, so a user search will not show if they are migrated. Instead, you could add a metadata flag to the user in the custom DB’s login script to mark them as migrated if you go with the automatic migration method. After their first login on the new connection with import mode enabled, Auth0 will no longer call the login script for the user and refer to its own DB.
/Example of including app_metadata to indication migration occurred
//update app_metadata to include a lazy migration flag
app_metadata: {
lazyMigration: true,
lazyMigrationTime: new Date().getTime()
}