Skip to main content

Export your users from Clerk

Export your users to move them to another Clerk instance or platform, or to keep a backup. Only the Clerk Dashboard export includes password digests and time-based one-time password (TOTP) secrets, and only the CLI and Backend API exports include metadata. No export includes backup codes. See what migrates between Clerk instances. There are three ways to export:

Export from the Clerk Dashboard

Workspace admins, and anyone in a personal workspace, can export a CSV of their application's users that includes the users' password digests. The Dashboard also keeps a history of exports and downloads.

To export your users' data:

  1. In the Clerk Dashboard, navigate to the instance's Settings.
  2. In the User exports section, select Export users.
  3. In the export history, select Download on the new entry.

To import this CSV into another Clerk instance, run clerk migrate import <path_to_csv> --source clerk. It keeps passwords and time-based one-time password (TOTP) secrets. See Migrate between Clerk instances.

Export with the Clerk CLI

To export your users with the Clerk CLI, run clerk migrate export clerk. It pages through the Backend API for you, stays within the rate limits, and saves your users as a JSON file, including public, private, and unsafe metadata, bans, and legal acceptance. It can't include password digests, because the Backend API doesn't return them. See Migrate between Clerk instances.

Export with the Backend API

To get users in your own code, use the GetUserList Backend API endpoint, or the getUserList() method, which wraps it. Each request returns up to 500 users. To list every user with the endpoint, set limit to an integer from 1 to 500, set order_by to created_at so users who sign up during the export are included, and omit offset. Pass the id of the last user on each page as starting_after, and keep every other parameter the same across requests. Stop when a page returns fewer users than your limit. If you use getUserList(), pass the ID as startingAfter. See Retrieve every user for an example. Every request counts toward the Backend API rate limits.

Feedback

What did you think of this content?

Last updated on