Best way to change region of Realtime Database?

782 views
Skip to first unread message

Andreas B

unread,
Dec 16, 2020, 3:33:41 AM12/16/20
to Firebase Google Group
I have an Android app that I want to publish early next year. Use of this app will be restricted to Europe - and while there's no personal information stored yet, it seems to be a good idea to future-proof this by moving the RTDB to a european location now rather than later, after release and with much more data to move.

The Firebase project for this is on a Spark plan right now, which means that I can't simply create an additional database in the same project.

There's an option to "disable database", so I wonder if it would be a viable way to:
1. export all data
2. delete all data
3. disable the current DB
4. create a new DB
5. import data

Will I be able to select a database region by doing so? Would there be any delay between deleting the current DB and being able to create a new one? If so, are we talking about days, weeks, months?

If this is not an option, what would be? Creating a new project and moving my app to that?

Thanks in advance for any ideas!

Sam Stern

unread,
Dec 16, 2020, 5:13:47 AM12/16/20
to Firebase Google Group
Hi Andreas,

This is a good question and I'm actually not quite sure, I think the best thing for you to do is to create a new project on the Spark plan and just try it out!  Create a database in the US region, delete it, and see if you're allowed to create a new database in the EU region.

Or maybe someone else on this mailing list will chime in with an authoritative answer :-)

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/48cb8148-8eff-44b5-842c-22eb7e9d710fn%40googlegroups.com.

Andreas B

unread,
Dec 16, 2020, 6:06:34 AM12/16/20
to Firebase Google Group
> I think the best thing for you to do is to create a new project on the Spark plan and just try it out! 

It can be so simple sometimes... ;)

So, regarding my question about disabling the old DB, then creating a new one - that doesn't seem to work. After disabling, there's just a button to "Enable" the same DB again. Creating a new one from scratch doesn't seem to be an option here.

However, when I did this test (caveat: on an already existing test project that didn't use RTDB before), I was not asked to choose a region while creating the DB for the first time. Did I do anything wrong (perhaps it has to do with this project already existing for a while), or is it expected behaviour that creating a DB from the console always creates it in us-central1 without user choice? If so, what else would I need to do to create a DB in europe-west1?

Andreas B

unread,
Dec 16, 2020, 10:34:39 AM12/16/20
to Firebase Google Group
Follow-up: Selecting a database location is possible in a new project. For what it's worth, I selected a Default GCP resource location ("eur3") in the project settings before creating a Realtime Database instance.

Sam Stern

unread,
Dec 17, 2020, 10:32:45 AM12/17/20
to Firebase Google Group
Hi Andreas,

Thanks for testing that out!  I'm not sure what's going on in that second question. I just created a brand new project and when I went to initialize Realtime Database for the first time it asked me to choose a location:

Screen Shot 2020-12-17 at 3.28.50 PM.png

I even went and created a Cloud Firestore instance in us-central and then went back to the RTDB flow and it still offered me both choices, which shows that the RTDB location does not depend on the overall Project location.

- Sam

Andreas B

unread,
Dec 21, 2020, 8:17:32 AM12/21/20
to Firebase Google Group
Thanks Sam,

selecting a DB location did indeed work in a new project. I was a bit afraid of moving the actual app to that new project, but that too worked like a charm. Thanks for all of your work! :)

Reply all
Reply to author
Forward
0 new messages