Search code examples
firebasefirebase-authenticationfirebase-cli

Importing firebase auth users into a project from storage


I have a backups folder in my firestore cloud console that contains all authenticated users. This JSON file, has been created by the auth users from a different project, but then imported into this one.

I am now trying to use firebase auth:import to add them to the authenticated tab on firestore but I am getting the following error:

Error: ENOENT: no such file or directory, stat 'gs://bunk-demo-app-backups/backups/20-08-31T22:00:53Z/users/users.json'

I have tried running the following command:

firebase auth:import gs://bunk-demo-app-backups/backups/20-08-31T22:00:53Z/users/users.json --hash-algo=SCRYPT --hash-key=`key` --salt-separator=`salt` --rounds=8 --mem-cost=14 --debug

Following this flow: https://firebase.google.com/docs/cli/auth

But It is still not recognising this as the correct file path, even though in the following screenshot, you can see that it is the exact path.

enter image description here

I do have full permissions for this project, so I'm not quite sure why the path cant be found.


Solution

  • I don't think that you can use the firebase auth:import CLI command with a file stored in Cloud Storage.

    If I am not mistaking, the JSON (or CSV) file should be on the same machine that triggers the CLI command.

    You could download the file from Cloud Storage and trigger the firebase auth:import CLI command with the corresponding "local" file path/name.