Migrating Database Users from One Tenant to Another Tenant

Last Updated: Aug 20, 2024

Overview

This article addresses the following question:

  • What is the best way to migrate users from a Database in one tenant to a Database in another tenant?

Applies To

  • User Import / Export
  • Database Migration

Solution

Exporting and importing users is the best method currently available to migrate users from one tenant to another. However, there are some caveats:

  1. Password hashes are not available via any of Auth0’s APIs for security reasons. A tenant administrator would need to raise a support ticket requesting this: User passwords .
  2. 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 mentioned here: JSON-compatible format

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, the steps to follow will be the following:

  1. Request a password hash export of the users via support ticket. Support will carry out some security checks before providing the file.
  2. 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.
  3. Convert the user export from ndjson format to JSON.
  4. Merge the password hash export data with the JSON export obtained in Step 2.
  5. Import the JSON into the new tenant.

More information about this topic can be read here.

Using Users Import/Export Extension

User Export

  1. Select Extensions > All Extensions tab and search for User Import/Export.
  2. Install the Extension and launch the Extension.
  3. If this is the first time, understand the required scopes and Continue.
  4. Click on Export and select Add Default Fields. Configure the Export Format and select which Connections for the export.
  5. Click on Export.

User Import

  1. Select Extensions > All Extensions tab and search for User Import/Export.
  2. Install or launch the Extension.
  3. Select Import on the right, and select which database the users are to be imported to.
  4. Drag or drop the JSON file and start importing users.
3 Likes