Auth0 Home Blog Docs

userId and schema for bulk import

user-import
#1

I was moving users from old tenant to new tenant.
My have issue the userId is getting updated in new tenant and could not retain the schema of JSON.
I was using import/export user plugin. Please let me know best way to proceed for this.

Thanks,
Adi.

#2

Hi @abhamidipati, specifying a user_id in a bulk import is not currently supported (hence why it is not documented in our Bulk Import Database Schema documentation).

If you’d like to import users and preserve their user ID’s, you can use a Custom Database connection, where you can set the user_id in the returned user profile from the Login script.

#3

Thanks @prashantT for the reply.

Is there option to import the app_metadata from the database connection?

1 Like
#4

Yes, you can set metadata in the JSON object of the user profile that is being returned to the callback.

Note: the property should be called metadata, rather than app_metadata when setting app_metadata the custom database script. See (3) in the custom db script documentation for more information.

#5

Hi @prashantT,

I have a similar requirement to preserve a custom database user_id during migration to Auth0.

While users are migrated to custom database using login/getUser scripts I can set custom user_id - no problems here.

However after cut-over date I need to migrate the rest of users using “Bulk Migration” and also preserve their custom user_ids.

The database is going to be the same, I’m just going to change return for both functions to callback(null,null).

What is the recommended way for “Bulk Migration” to custom database in that case (preserving custom user_id)?

Thanks.