Auth0 Email Conflict During Automatic Migration With Custom Database Connections
Last Updated:
Overview
During an automatic migration using a custom database connection, Auth0 queries the legacy database via the getUser script, which causes duplicate email conflicts if the legacy data is outdated. Synchronizing email updates between Auth0 and the legacy identity store resolves this issue. Users encounter an error during signup or email update attempts when the email address is not visible in the Auth0 Dashboard or returned by the Management API.
“The specified new email already exists”
Applies To
- Auth0
- Custom Database Connection
- User Profile Creation
- Import / Export
Cause
During an automatic migration, Auth0 continues invoking the getUser script to validate whether a user exists in the legacy identity store. If a user updates an email address in Auth0 but the corresponding email in the legacy database remains unchanged, the getUser script returns the old email. Auth0 detects the old email as an existing identity and treats the email as already in use. Attempts to reuse or reassign the email fail. This behavior occurs when users change an email address after migration, legacy systems remain active during a phased migration, email synchronization between systems is incomplete, or the getUser script returns outdated profile data.
Solution
How are email conflicts resolved during automatic migration?
Synchronize email updates across systems, verify the getUser The script returns current data, validates legacy records, and finalizes the migration strategy.
- Keep email changes synchronized by ensuring email updates propagate to both Auth0 and the legacy identity store during phased or long-running migrations.
- Review the custom database
getUserscript and confirm that it returns the most recent email address, does not reference stale cached records, and properly reflects updates made after migration. - Validate legacy records before a bulk or trickle migration by auditing legacy user records for duplicate emails, removing orphaned accounts, normalizing email casing and formatting, and verifying uniqueness constraints in the legacy database.
- Finalize the migration strategy by disabling legacy lookups where possible, retiring custom database scripts, and transitioning fully to native Auth0 user management.
Additional troubleshooting steps verify the email status.
Verify the email status in the legacy identity store and review custom database script logs.
- Check whether the email still exists in the legacy identity store.
- Review custom database script logs.
- Confirm whether the getUser script is still executing.
- Search for users using normalized or case-insensitive email comparisons.
Related References