There is no built-in method via Firebase. However, since Firebase uses Google Cloud Storage behind the scenes for Firebase Storage it's possible to use the gutils Tool.
- Make sure Python (2.7.9+) is installed on your machine
- Go to the Google Cloud SDK page and follow the directions to download and install Google Cloud SKD on your OS.
- At the end of the Google SDK installation you should have run
gcloud init. This will ask you to select your project and authenticate you. Since Firebase uses Google Cloud Platform behind the scenes your Firebase project should be available as a choice.
- In order for Google Cloud Utils to download the files that were uploaded with Firebase permissions you need to give your account Firebase Privileges. Go to the IAM page and select your email address you signed into
cloud initwith. In the list of available permissions you need to select
Firebase Rules Systemfrom the
- Get your Google Storage URL from the Firebase Storage Page in the dashboard (Towards the top) Should look something like this:
- In command line on your local machine navigate to the folder you want to do a local backup to. Make sure you are in the folder you want as the following command will download all files right there in current folder.
- Run the gutil command
gsutil -m cp -R gs://<bucket_name> .
menables multithreading for faster downloads if you have many files.
cpis the copy command
Ris recursive. If enabled it will download all files and folders in the specified tree.
- You're done! This will run for some time depending on the size of your storage.
This can be used to also make a copy(backup) to another Google Cloud Storage Bucket or AWS etc.