Issue with `identities.connection` Field During Bulk User Import

Description:
During a bulk user import into Auth0, I noticed that the identities.connection field in the imported user data retains the database connection name of the original database from which the data was exported. This is happening despite the users being imported into a new database connection within the same tenant.
Additionally, users in the new database connection have the same user_id values as the users in the old database connection.

For example:

  • Original database connection: old-database-connection
  • New target database connection: new-database-connection
  • After import, the identities.connection field for each user still shows old-database-connection.

User in new database connection

"identities": [
        {
            "connection": "old-database-connection",
            "user_id": "",
            "provider": "auth0",
            "isSocial": false
        }
    ],

Questions:

  1. Why isn’t the identities.connection field updated to reflect the name of the new database connection during the import process?
  2. Will this discrepancy cause any issues? Specifically:
    • Management: Will it interfere with managing these users under the new database connection?

Additional Context:

  • The original database connection still exists in the same tenant.
  • The import job completes successfully without errors.
  • All other fields in the imported user profiles seem accurate.

I would appreciate clarification on whether this behavior is expected and any potential consequences of leaving the identities.connection field unchanged. If this could lead to issues, what would be the recommended steps to correct it?

Thank you!

Hi @himashya.fonseka,

You might be importing these users with the identities.connection already referencing your old-database-connection.

You should either export these users without the identities.connection array or manually remove it after export.

Then, during the import, you can select which database these users should be imported to, and the old-database-connection will not be included.

Thanks,
Rueben

(post deleted by author)

Hi rueben.tiow,

After reading auth0 documents I solved my issue and your solution is some what incorrect because according to User Profile Structure auth0 doc identities field cannot be imported. And also auth0 does not allow editing or updating the identities.connection field. So, I think it is not possible manually remove or change the identities.connection array.

The real reason for my issue was that I was importing users from a database connection to a database connection within the same tenant with the same user_id fields and according to auth0 the user_id fields must be unique for all the users within a tenant.

But auth0 allows creation of users with the same user_id and replaces fields that it does not allow importing with the data from the original user. So, in my case the users with the same user_id had the same identities.connection fields even though the user was in a different database connection.