Firebase-tools: Firebase auth import from firebase to firebase

Created on 31 Jan 2017  路  11Comments  路  Source: firebase/firebase-tools

Hello, i am having some issues while trying to migrate auth users from one firebase project to another.

I followed this steps to get a json of the auth users in a project. Now i need to import them to another firebase project.

looking at the auth:import commands i would need the hash-algo for the import command, wish i found here that the new firebase is now using SCRYPT. But i still need the rounds and i guess the mem-cost for the import command.

Most helpful comment

These details are available through firebase admin now. Navigate to

Console > Project > Authentication > Three little dots on right side of all users > Password Hash Credentials

image

All 11 comments

Does it work if you leave those parameters out?

No, if i enter the command:
$ firebase auth:import users.json --hash-algo=SCRYPT

i get the error:
Error: Must provide valid rounds(1..8) for hash algorithm SCRYPT

If you contact custom support, they can give you detailed parameters for SCRYPT. But currently, the auth:import code still has a bug. It needs to pick up hash-key from command line options which I ignored before. We'll publish a new version to fix it and make sure the migration can work for you.

BTW, our auth:export will be available soon. This one will be deprecated.

Thanks.

Good to know,

Thanks for the help.

Hey zetos,

New auth:import and auth:export are available now! You can check the doc for more details.

I still get error ! No hash algorithm specified. Password users cannot be imported. when I leave parameters out in auth:import. In this case users are created, but passwords don't work (INVALID_PASSWORD errors on login)
If I type firebase auth:import users.json --hash-algo=scrypt --rounds=8 --mem-cost=14 as in given example here, I get Error: Must provide hash key(base64 encoded) for hash algorithm scrypt

Hi Bogac,

You still need hash key and salt separator for scrypt. Doc is here. You can contact customer support to get these two parameters.

We need to update the doc you attached. Thanks.

Right now the only way to get those parameters is by contacting the custom support.

These details are available through firebase admin now. Navigate to

Console > Project > Authentication > Three little dots on right side of all users > Password Hash Credentials

image

I feel like we should add @pratiknikam 's response to the documentation for auth:export and auth:import.

We should also specify --project under an example command line.

I.E.
Screen Shot 2020-09-04 at 3 22 22 PM

And add
--project projectid

Otherwise, it's hard to go find the parameter to specify the project that we are trying to import to.

@ptkpyitheim that's a good idea, I'll add a note about password hash parameters.

Was this page helpful?
0 / 5 - 0 ratings