It seems that this question, has in many different manners been asked (most promising were this post and this one.
However, they are either above my current familiarity with google services or formulated in a manner where I’m not confident this is the same problem. As I can’t imagine being the only one having to do this, here is the question:
I have two Firestore projects:
- One for development.
- One for my users.
There is a certain collection that contains documents, that contain collections… on which I work in the dev project and now, it feels ready to be moved to the other project.
How can that be done?
(I can’t imagine that waiting for an improved version of a handcrafted dataset to be errorfree before giving it to the users is a rare scenario.)
Here is what I’ve done so far:
- Used the import/export feature:
- Created a bucket in dev project, created a bucket and exported the collection there (all using Googles UI, not command line)
- Switched projects, went to Google Cloud storage tab, created a bucket.
- Clicked on the bucket, and pressed “Transfer data” and then “Transfer data in”.
- Find the dev project in the dialog, find the exported collection, select it and move it to the bucket. Leave all options as default and started the job.
- Go back to firebase interface, let it send me to Google Cloud Firebase (why is that so cumbersome to access?) and then import from the bucket the desired collection (for some reason I had to tweak the name for it to work).
- Finally, I can see the collection in my projects firestore database.
- I was Happy. Until I realized that all the subcollections were missing!
- Tried some things with the CLI but was unsuccessful .
- Enabled BigQuery in both projects but found it confusing.
- Tried to install “Firefoo” which claims to do exactly that but the installer is broken.
- I have given up due to the uncertainty of the subcollections and documents containing them being moved as well on exports.
So what is the proper way of doing that? (Or are you not meant to move work on some data in your dev project to then move it to prod when its ready?)
And why does it seem so complicated?
Pastudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.