firestore-backup-restore icon indicating copy to clipboard operation
firestore-backup-restore copied to clipboard

Wrong Setup in Index.ts

Open thanh01pmt opened this issue 4 years ago • 2 comments

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
}

thanh01pmt avatar Feb 20 '21 15:02 thanh01pmt

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.

dalenguyen avatar Feb 22 '21 02:02 dalenguyen

@thanh01pmt

ilovealbasit avatar Oct 29 '22 06:10 ilovealbasit