firestore-backup-restore
firestore-backup-restore copied to clipboard
Wrong Setup in Index.ts
There is no key "databaseURL" in "servicceAccount" => This affects to Initialize App when import Json to Firestore in my case.
export const initializeApp = (serviceAccount: object, name = '[DEFAULT]') => {
if (
admin.apps.length === 0 ||
(admin.apps.length > 0 && admin.app().name !== name)
) {
admin.initializeApp(
{
credential: admin.credential.cert(serviceAccount),
databaseURL: serviceAccount['databaseURL'],
},
name
)
admin.firestore().settings({ timestampsInSnapshots: true })
}
return true
}
Hi @thanh01pmt, can you add the databaseURL to your serviceAccount file?
Or initialize by using normal process, then you can use the backup & restore feature.
Let me know if it works.
@thanh01pmt