Skip to content

Conversation

@wassimoo
Copy link

Related Issue or Design Document

Fixes the Auth0 export script and improves the migration guide documentation for better clarity.

Changes

Script Fixes (0-get-auth0-user-data.sh)

  • Added error handling and validation for environment variables.
  • Fixed connection_id string interpolation bug.
  • Improved polling logic with proper error states handling.
  • Better user feedback with clear success/error messages.

Documentation Improvements (auth0.mdx)

  • Restructured content into three clear phases:
    • Prepare Auth0 data.
    • Configure Ory project.
    • Import users to Ory.
  • Added prerequisites section with all requirements upfront.
  • Added tip box for finding project/workspace IDs.
  • Clarified file outputs: script creates AUTH0_USERDATA.json automatically.
  • Enhanced post-migration section with verification and testing steps.

Impact

  • Prevents silent script failures with proper error handling
  • Makes migration guide easier to follow with logical phase structure

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

@CLAassistant
Copy link

CLAassistant commented Oct 27, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@vinckr vinckr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
looks pretty good already, I would do a test of the script and left some comments on style.

I think the numbered list here don't add anything and in general would be better without.
there are 2 steps only anyway so its not that hard to navigate and just looks confusing in the ToC (see screenshot below).

So please remove the Phase X parts and numbered list in headings.

also in line with the style guide: "Avoid using symbols and special characters in headings."

Image

:shipit:

bash <(curl https://raw.githubusercontent.com/ory/docs/master/code-examples/migrate-to-ory/0-get-auth0-user-data.sh)
```

This script creates `AUTH0_USERDATA.json` in your current directory containing all exported user data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This script creates `AUTH0_USERDATA.json` in your current directory containing all exported user data.
This script creates `AUTH0_USERDATA.json` in your current directory and contains all the exported user data.

- **Auth0 account** with admin access to export user data
- **Ory account** and CLI installed
{/* TODO: change this to refer to new migration guide (docs/migrate-to-ory/migrate/create-project.mdx) */}
- **Ory project** created - See [creating a project](index.mdx) for instructions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should link to here for create project: docs/migrate-to-ory/migrate/create-project

export them as part of the general export process. To get the password hashes and other password-related information, you must
[create an Auth0 support ticket](#create-auth0-support-ticket).

If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they
- If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they used before the migration. For more information, see [Bulk identity migration](../migrate-to-ory/migrate/migrate-strategies#bulk-identity-migration).

[create an Auth0 support ticket](#create-auth0-support-ticket).

If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they
used before the migration. If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
used before the migration. If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate
- If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate
them using a [Password migration hook](../kratos/manage-identities/25_import-user-accounts-identities.mdx). For more information, see [Graceful identity migration](../migrate-to-ory/migrate/migrate-strategies#graceful-identity-migration).


If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they
used before the migration. If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate
them using a [Password migration hook](../kratos/manage-identities/25_import-user-accounts-identities.mdx).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
them using a [Password migration hook](../kratos/manage-identities/25_import-user-accounts-identities.mdx).

### Create bulk user export

To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API
Access Token and the ID of your connection. This data is used by the migration script you run to get the user data. You can
Copy link
Contributor

@unatasha8 unatasha8 Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Access Token and the ID of your connection. This data is used by the migration script you run to get the user data. You can
Access Token and the ID of your connection. You will need this information to export the Auth0 user data, when you run the migration export script.


To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API
Access Token and the ID of your connection. This data is used by the migration script you run to get the user data. You can
inspect the script
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inspect the script
You can inspect the export script


### Create bulk user export

To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API
To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need the Management API

## Import users to Ory

To import your Auth0 users to Ory, you must create new users in Ory and associate them with the imported data.
### Configure environment variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Configure environment variables
### Set environment variables

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to keep it consistent with previous section

- Auth0 account with admin access to export user data
- Ory account and CLI installed
- Ory project created - See [creating a project](docs/migrate-to-ory/migrate/create-project.mdx) for instructions
- Required tools:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a bullet for the migration scripts. For example: "Export
and import migration scripts."

Copy link
Contributor

@unatasha8 unatasha8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a bunch of suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants