How do I delete a database from Firebase?
Asked Answered
M

6

37

This must be staring me in the face, but don't see the command. How do I delete an unused Firebase DB from the Console in the new Firebase? And Google did not help with an answer, which is kind of a first.

Magistral answered 14/7, 2016 at 11:56 Comment(1)
Delete option is now available https://mcmap.net/q/415409/-how-do-i-delete-a-database-from-firebaseLuigi
O
19

THIS DELETES THE ENTIRE PROJECT

To delete ONLY the database just delete the top level object/node.


Click on your project (the white box below, hiding name):

project

Then click on gear (settings) icon and click "Project Settings":

settings

Scroll to bottom and click "DELETE PROJECT":

delete

Osage answered 14/7, 2016 at 12:24 Comment(2)
this deletes the entire project, but not an individual RTDBFeudatory
@Feudatory as noted in your comment on my answer, a project contains only 1 instance of RTDB. If you want to completely wipe it out, you must delete the project. If you simply want to empty its contents, follow my answer example below and "Import" a file with an empty JSON object {}Himes
H
29

Another way if you don't want to delete the project, and just the database, is to create a file on your computer empty.json like this:

{}

Then click on the ... and "Import JSON" Import JSON

Then "Browse" and upload your empty file: enter image description here

You overwrite your database with an empty JSON file, effectively "deleting" the old database.

Himes answered 22/6, 2017 at 3:48 Comment(5)
this still displays the RTDB in the DB list, with a name that can't be changedFeudatory
It's not clear what you mean @Feudatory . If you want to completely delete the RTDB, you delete your Firebase project (accepted answer). My answer provides an alternate solution for reader's convenience. By importing an empty object, you are not deleting the database itself, you are just setting it's value to null (empty dictionary or map). You can "import" an empty JSON object from any node in the tree and it's children will all be wiped out.Himes
I have one project with multiple RTDBs. I'd like to remove one of the RTDB, or at least hide it from view (to avoid confusing because of poor naming)Feudatory
Incredible! It's mind blowing this feature is not in the UI. In my limited research I've seen some very complicated solutions, this took 30 seconds. Thank you.Roodepoortmaraisburg
This should be the accepted answer. Easy and fast.Brooksbrookshire
O
19

THIS DELETES THE ENTIRE PROJECT

To delete ONLY the database just delete the top level object/node.


Click on your project (the white box below, hiding name):

project

Then click on gear (settings) icon and click "Project Settings":

settings

Scroll to bottom and click "DELETE PROJECT":

delete

Osage answered 14/7, 2016 at 12:24 Comment(2)
this deletes the entire project, but not an individual RTDBFeudatory
@Feudatory as noted in your comment on my answer, a project contains only 1 instance of RTDB. If you want to completely wipe it out, you must delete the project. If you simply want to empty its contents, follow my answer example below and "Import" a file with an empty JSON object {}Himes
M
12

It's currently not possible to delete other Realtime Database instances created via Firebase Console.

They do have plans for adding the feature,but It'll come in the future. For now, you can watch their updates here:

Their support suggested me to wipe all data and to lock down the database to prevent any usage, as a work-around for now.

Just remembering that having multiple instance is only possible if you have a Blaze account.

Muscovite answered 15/5, 2018 at 12:46 Comment(0)
L
7

Looks like Google recently introduced this feature to delete a Firebase RTDB. To delete this (after we raised this concern with Google Firebase team on Firebase RoadShow India 😃).

To do this, follow these steps:

  1. Go to your Firebase RTDB which you want to delete
  2. Delete all your data from the database
  3. Select the 3 dots on the top right corner

enter image description here

  1. Hit the "Disable Database" button

  2. After the database is disabled, hit that 3 dots again and click "Delete Database"

enter image description here

Cheers!

Luigi answered 8/7, 2019 at 11:42 Comment(10)
second step "Delete all your data from the database" imposible for huge data.Colpin
What do you mean by impossible? Is Firebase not allowing you to delete it?Luigi
yes if you have few entity but subject is huge data. there is no drop table as other RDBMS.Colpin
I deleted all my data and disabled the database, but I don't get the "delete database" option on the drop down as you show in the picture just above. I decided to use Firestore instad and I just want to get rid of the real time database to avoid confusion, but still doesn't seem to be possible.Rafi
Are you the owner or do you have sufficient permission?Luigi
Yes I’m the ownerRafi
As of today, this solution is NOT working. I think Google has removed the Delete Database option and it needs to delete the project altogether and create a new one or buy their pro plan(s); which is pathetic for learners.🙁Svend
I just checked. It's there. You need to first disable it and then you will get option to delete it.Luigi
@ShashankAgrawal the interface is significantly different than your screens above. After deleting the only collection, and disabling the DB via the 3dot menu, the only thing that now shows in the 3dot menu is "Create new database". Are you looking elsewhere to delete the DB? I also am experimenting with Firebase and trying to figure things out, but can operate on RTDB no further because of this "you must now buy it" meme.Mantra
This works in 2022 but only for non-default databases. Default database cannot be deleted nor can its location be changed which is so disappointingCarbonation
A
0

If the dots method doesn't work then here's another option-

  1. Open the project you want to delete.

  2. Go to setting (on the left side of the page|near Project Overview).

  3. Select project settings.

  4. You'll find delete project option at the end of that page (below app config).

  5. Then you'll be asked things about the policy of deleting the project and your preference and stuff... you can answer accordingly.

Accompanyist answered 27/10, 2020 at 8:41 Comment(0)
T
0

Currently its only possible to delete a database from gcloud CLI

First, install gcloud

Get the list of available databases:

gcloud alpha firestore databases list

Update:

note:

You cannot reuse a database ID until 5 minutes after the delete happens.

Then delete:

gcloud alpha firestore databases delete --database="(default)" # or use another id here

Note:

You cannot reuse a database ID until 5 minutes after the delete happens.
Twicetold answered 8/11, 2023 at 15:57 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.