From 7a337a8aa5c65ce6e6e2638c1a632a09b3a1d8b6 Mon Sep 17 00:00:00 2001 From: Fabi Date: Thu, 27 Apr 2023 09:26:58 +0200 Subject: [PATCH] docs: Migrate auth0 users (#5705) * docs: auth0 migration, add zitadel migration tool * docs: auth0 migration, add zitadel migration tool * use binary * fix typo --------- Co-authored-by: Livio Spring --- docs/docs/guides/migrate/sources/auth0.md | 36 +++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/docs/guides/migrate/sources/auth0.md b/docs/docs/guides/migrate/sources/auth0.md index dca95a7c3..977385c1c 100644 --- a/docs/docs/guides/migrate/sources/auth0.md +++ b/docs/docs/guides/migrate/sources/auth0.md @@ -7,6 +7,7 @@ Migrating users from Auth0 to ZITADEL requires the following steps: - Request and download hashed passwords - Export all user data +- Run migration tool to merge Auth0 users and passwords - Import users and password hashes to ZITADEL ## Export hashed passwords @@ -34,8 +35,37 @@ See this [community post](https://community.auth0.com/t/password-hashes-export-d Create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports) from the Auth0 Management API. You will receive a newline-delimited JSON with the requested user data. +This is an example request, we have included the user id, the email and the name of the user. Make sure to export the users in a json format. + +```bash +curl --request POST \ + --url $AUTH0_DOMAIN/api/v2/jobs/users-exports \ + --header 'authorization: Bearer $TOKEN' \ + --header 'content-type: application/json' \ + --data '{ + "connection_id": "$CONNECTION_ID", + "format": "json", + "fields": [ + {"name": "user_id"}, + {"name": "email"}, + {"name": "name"}, + ] +}' +``` + +## Run Migration Tool + +We have developed a tool that combines your exported user data with their corresponding passwords to generate the import request body for ZITADEL. + +1. Download the latest release of [github.com/zitadel/zitadel-tools](https://github.com/zitadel/zitadel-tools/releases) +2. Execute the binary with the following flags: + ```bash + ./zitadel-tools migrate auth0 --org= --users=./users.json --passwords=./passwords.json --output=./importBody.json + ``` + Use the Organization ID from your ZITADEL instance where you like to add the users. +3. You will now get a new file importBody.json which contains the body for the request to the import of ZITADEL + ## Import users and password hashes to ZITADEL -You will need to merge the received password hashes with the user bulk export. - -After you successfully merged the datasets, you can follow the instructions described in the [Migrate Users](../users) guide to import users to ZITADEL. +Copy the content from the importBody.json file created in the last step. +You can now follow the instructions described in the [Migrate Users](../users) guide to import users to ZITADEL.