1
votes

I am trying to migrate my users to other project in firebase (both projects are using firebase).

This is the command I ran to export them:

firebase auth:export users.json --format=json --project troy

And then I imported them into the other project:

firebase auth:import users.json --project trojan

It seemed to have worked, and I see my users on my new project, I enabled the same sign in methods but users can't login with the same passwords, I had to reset a password in order to be able to login in my new project.

Is there some step I am missing?

1
Were the accounts created in the first project, or were they imported from somewhere else? - Jen Person
They were created on the first project. Thanks. - Multitut

1 Answers

2
votes

You have to make sure the hashing algorithm parameters are set correctly. That would be SCRYPT with (hash-key, salt separator, rounds, mem-cost) from original project. You can get these from Firebase Console -> Authentication -> Users and then select the "Password hash parameters" (top right corner of users table). It will look like:

hash_config {
  algorithm: SCRYPT,
  base64_signer_key: KEY,
  base64_salt_separator: SEPARATOR,
  rounds: n,
  mem_cost: c,
}