Email Conflict During Automatic Migration with Auth0 Custom Database Connections
During Automatic (Trickle) Migration using a Custom Database connection, users may encounter the following error during signup or email update attempts:
“The specified new email already exists”
This error can occur even when the email address is not visible in the Auth0 Dashboard or returned by the Management API.
In many cases, the issue is caused by stale user data remaining in the legacy identity store while Auth0 continues to rely on the getUser script during migration.
- Custom Database (DB) Connection
- User Profile Creation
- Import / Export
During Automatic Migration, Auth0 may continue invoking the getUser script to validate whether a user exists in the legacy identity store.
If a user’s email address is updated in Auth0 but the corresponding email in the legacy database is not updated, the old email may still be returned by the getUser script.
As a result:
- Auth0 detects the old email as an existing identity.
- The email is treated as already in use.
- Attempts to reuse or reassign the email fail with:
“The specified new email already exists”
This behavior is most commonly observed when:
- Users change their email address after migration.
- Legacy systems remain active during phased migration.
- Email synchronization between systems is incomplete.
- The
getUserscript returns outdated profile data.
To resolve and prevent this issue:
- Keep the email changes synchronized.
Ensure email updates are propagated to both:
-
- Auth0
- The legacy identity store
This is important during phased or long-running migrations.
- Ensure thant
getUserreturns current data.
Review the Custom Database getUser script and confirm that it:
-
- Returns the most recent email address.
- Does not reference stale cached records.
- Properly reflects updates made after migration.
- Validate legacy records before migration.
Before bulk or trickle migration:
-
- Audit legacy user records for duplicate emails.
- Remove orphaned accounts.
- Normalize email casing and formatting.
- Verify uniqueness constraints in the legacy database.
- Consider Migration Finalization Strategies
Once migration is complete:
-
- Disable legacy lookups where possible.
- Retire Custom Database scripts.
- Transition fully to native Auth0 user management.
This reduces the risk of stale identity data causing future conflicts.
Additional Troubleshooting
If the email is not visible in the Dashboard or Management API:
- Check whether the email still exists in the legacy identity store
- Review Custom Database script logs
- Confirm whether the getUser script is still being executed
- Search for users using normalized or case-insensitive email comparisons