Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I change the default database in Firebase RTDB?

I created a database in the Firebase Realtime project, but now it seems that the location I picked was not the best choice, therefore I wanted to migrate the data.

It turns out that there is no possibility to automatically move/migrate the database, so I figured I would remove the invalid DB, create a new one and set it as default, then remove the old one.

Unfortunately, it seems that this is impossible as the default database doesn’t have ‘Delete’ option as documentation mentions. API methods for firebase admin management don’t have this feature listed as well.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The question is: is it possible / how to set another database as a default one?

Thanks and best regards!

>Solution :

It turns out that there is no possibility to automatically move/migrate the database.

Yes, there is no way you can change the default location of the database, once it was created.

The question is: is it possible / how to set another database as a default one?

No, you cannot create "another" default database. What you can do, however, is to create a new instance of the Realtime Database that can be located in a totally different location than the default one. According to the official documentation of the Realtime Database locations:

If you create a new Realtime Database instance, you’re prompted to select the location of the instance in the Firebase console workflow. Each Realtime Database instance in your project can be located in a different location. The currently supported locations for Realtime Database instances are listed below along with their associated database URL schemes.

And then use it accordingly. It’s not the default one, but it will indeed do the job.

Please also see below, how you can set a different the location to a database:

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading