willhlaw / node-firestore-backup-restore

Google Firebase Firestore backup and restore tool
91 stars 24 forks source link

Error while Cloning or Restoring documents with 'reference' type fields from one project to another (related to closed issue #9) #27

Closed pobochiigo closed 6 years ago

pobochiigo commented 6 years ago

firestore-backup-restore --accountCredentials /source.json --backupPath /path --restoreAccountCredentials /target.json

I have just tried it out in versions 1.2.1, 1.3.1 and the error is still there.

Error! Restoring to collection /releases document ylMxpcTV13Tj5JzVbBP6 - Error: 3 INVALID_ARGUMENT: Reference value app: "arccompsdemo" PathElement { type: "versionCode" name: "kWuGZp1knaowVxgKgkxH" } in different app partition

pobochiigo commented 6 years ago

I could try to fix it but not sure where to look for.

pmarconi commented 6 years ago

I close this issue, and we can keep the discussion in #9

willhlaw commented 6 years ago

TLDR; break up the clone into 2 steps. Backup and then restore. The references will change correctly. Doing a clone (backup and restore immediately) skips the proper code execution to change the references.

As @pmarconi said, this has been moved to #9.