What is the best way to migrate users from a Database in one tenant to a Database in another tenant?
Exporting and importing users is the best method currently available to migrate users from one tenant to another. However, there are some caveats:
- Password hashes are not available via any of Auth0’s APIs for security reasons. A tenant administrator would need to raise a support ticket to request this:
- Users need to be imported in JSON format, however for performance reasons, users are exported from Auth0 tenants in ndjson format, so the export would have to be converted as described here:
For the users not having to go through a password reset flow when logging into the new tenant, the password hash would need to be included in the import file. If this is the case, you need to follow these steps:
- Request a password hash export of the users via support ticket. Support will carry out some security checks before providing the file.
- This file would only include hashes and IDs. For the rest of the profile data, it is necessary to perform an export from the tenant using the Import/export extension or the Management API.
- Convert the user export from ndjson format to JSON.
- Merge the password hash export data with the JSON export obtained in Step 2.
- Import the JSON into the new tenant.
More information about this topic can be found here: