apps/docs/content/guides/platform/migrating-to-supabase/firebase-auth.mdx
Supabase provides several tools to help migrate auth users from a Firebase project to a Supabase project. There are two parts to the migration process:
firestoreusers2json (TypeScript, JavaScript) exports users from an existing Firebase project to a .json file on your local system.import_users (TypeScript, JavaScript) imports users from a saved .json file into your Supabase project (inserting those users into the auth.users table of your Postgres database instance).Clone the firebase-to-supabase repository:
git clone https://github.com/supabase-community/firebase-to-supabase.git
In the /auth directory, create a file named supabase-service.json with the following contents:
{
"host": "database.server.com",
"password": "secretpassword",
"user": "postgres",
"database": "postgres",
"port": 5432
}
On your project dashboard, click Connect
Under the Session pooler, click on the View parameters under the connect string. Replace the Host and User fields with the values shown.
Enter the password you used when you created your Supabase project in the password entry in the supabase-service.json file.
firebase-service.json.base64_signer_key, base64_salt_separator, rounds, and mem_cost.hash_config {
algorithm: SCRYPT,
base64_signer_key: XXXX/XXX+XXXXXXXXXXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==,
base64_salt_separator: Aa==,
rounds: 8,
mem_cost: 14,
}
node firestoreusers2json.js [<filename.json>] [<batch_size>]
filename.json: (optional) output filename (defaults to ./users.json)batchSize: (optional) number of users to fetch in each batch (defaults to 100)auth.users) [#import-json-users-file]node import_users.js <path_to_json_file> [<batch_size>]
path_to_json_file: full local path and filename of JSON input file (of users)batch_size: (optional) number of users to process in a batch (defaults to 100)For more advanced migrations, including the use of a middleware server component for verifying a user's existing Firebase password and updating that password in your Supabase project the first time a user logs in, see the firebase-to-supabase repo.
Contact us if you need more help migrating your project.