Transfer registered users from one firebase app to another

后端 未结 3 1655
逝去的感伤
逝去的感伤 2021-02-04 02:56

My firebase app has a list of registered users. These were created with Email & Password Authentication.

I want to transfer the firebase data and the list of users t

相关标签:
3条回答
  • 2021-02-04 03:24

    Just got this from Firebase Support:

    Just recently Firebase, has rolled-out the new API for downloading your Firebase Auth users. To migrate your users to/from other Firebase projects, you may use this new CLI auth:export tool which is available at Github. For more information you may check on our Firebase docs. Additionally, we made a guide for importing/exporting users on your projects.

    0 讨论(0)
  • 2021-02-04 03:32

    You should use the Firebase admin tools.

    You may install the admin tools using this command:

    npm install -g firebase-tools
    

    Export command, that generates the AllUsers.json file:

    firebase auth:export AllUsers.json --project projectId
    

    On the other account use the following command to import the generated file.

    firebase auth:import AllUsers.json --project projectId
    
    0 讨论(0)
  • 2021-02-04 03:41

    The answer above doesn't work by it self as all the passwords from the previous project will have different password hashes. You need to specify the old hash (exporting project) when you import the new users.

    Click on this menu item and all of the settings you need for doing the firebase auth:import command will show up. Here's what I see:

    hash_config {
      algorithm: SCRYPT,
      base64_signer_key: <long string of random characters>,
      base64_salt_separator: <short string of random characters>,
      rounds: 8,
      mem_cost: 14,
    }
    

    I can then do the command successfully

    firebase auth:import ./users.json --hash-algo=scrypt --rounds=8 --mem-cost=14 --hash-key=<long string of random characters> --salt-separator=<short string of random characters>
    

    How to set hash-key option for auth:import after default auth:export in firebase?

    0 讨论(0)
提交回复
热议问题