I'm looking to clone an entire Firebase project to create a testing version of the database with the existing security rules and user accounts (and their passwords) in place. Is there an easy way to do this?
Thanks
According to other similar questions, no, there is no easy way to do this.
Google pushes their Firestore product which seems to allow this more easily, over the free/low cost Firebase Realtime Database, so I wouldn't hold your breath on new functionality within the original Firebase Realtime Database.
Cloning firebase users refer to this document Import users or you can visit this question for a solution duplicate firebase.
Related
We are a team of developers working on an app for one and a half years, with the backend using Firebase and Firestore as cloud database. We have several owners and contributors to this project. Now our Firestore data and user authentication data have been deleted and we've lost almost everything. Is there a way to see which owner/contributor has deleted our data? And most importantly is there a way to retrieve this deleted data? Thanks in advance.
Note: We are on the Blaze (paid) plan of Firebase.
You can enable audit logs for Firestore to log all operations on the database to Cloud Logging and Cloud Monitoring. That way you can see exactly what happened. You have to opt-in to this though, so this will only help you see who did what after you enable it.
Currently there is no way to find out which collaborator on the project or which Authentication user deleted the data from Firestore.
If the data got deleted accidentally from your database,as Renaud Tarnec mentioned above in comment, you can reach out to Firebase support and ask for the data to be restored.
You can also check out Announcing Automated Daily Backups for the Firebase Database.
I have read a lot about read/write rules in the Realtime database, but I have not found any information on how to block changes from the console itself.
I am setting up a process where we have a repo for the content, and then push to the realtime database to deploy.
I would like to enforce this method and make it impossible to update it from the firebase console. Can this be achieved?
I still want people to have 'Editor' privilege of the rest of firebase though.
The built-in roles provide a collaborator similar permissions to groups of Firebase services, so they may not be flexible enough to allow this use-case.
Luckily you can also define a custom role in the Cloud console, which allows you fine grained control over what a collaborator can do.
Also see my longer answer (with screenshots) here: Firebase Storage View by certain users
So my current flutter project has all users logged in with only google accounts.
Is there a way to query for user UIDs with the user's gmail or google username?
Another followup question:
I can't seem to find a clear documentation for firebase for flutter specifically, is there something like this out there?
There is no way to query across the users in Firebase Authentication from the client-side SDKs, as that would be a security risk.
If you want to allow users to find other users, the two most common approaches are:
Store information about each user in the database (typically either Realtime Database or Cloud Firestore), and search across that.
Wrap the relevant parts of the Admin SDK in a Cloud Function, and call that from your app.
While the second may sound simpler/more common at first, using a database is actually by far more common with Firebase and allows more flexibility for relatively low complexity.
I have built an app using firestore as we are interested in the realtime updates portion of things. However,we are not building a website that has CRM component where a lot of reports will be generated. The contents of that CRM are all new. There is only one report that would need firebase data as well as the new data (you can say 1 report out of 20).
I was thinking of building the CRM backend off mysql DB? Do you recommend to go with this approach or shall I do the CRM in the same firebase/firestore db?
Thanks
If you are looking for a real-time backend database for your CRM, then the Firebase RTDB / Cloud Firestore would be ideal for this. I'm not sure why you'd want to add a mySQL component, unless you are going to create some reports that require complex joins. However, if your data is modelled correctly, this also shouldn't be an issue.
Take a look at this video to get a better understanding: What is a NoSQL Database? How is Cloud Firestore structured? - Get to Know Cloud Firestore Ep.1
I have an app that uses Firebase and I have a few people that need to be able to update data in the Firebase Dashboard. Luckily, Firebase added the feature to add collaborators. But the problem is, I don't want these collaborators to have access to every node of the JSON. Is there a way that I can assign collaborators specific access to certain nodes of the data structure or no?
Any feedback would be great. Thanks!
Collaborators on the Firebase project/app have access to all data. There is no way to limit that.
It sounds like you are looking to add application administrator. For this you'll have to develop your own application dashboard, where you add such functionality. These application administrators are then just regular users of your app and you can use Firebase security rules to determine what data they have access to.
Very similar: Stopping accidental deletion of a firebase DB via Firebase Dashboard