2
votes

I have two projects A and B. I have data exported from project A's firestore database, to project's A cloud storage bucket and later imported in project's B cloud storage bucket. How can I move data from project's B cloud storage bucket into it's firestore database?

From the official docs I can only find how to move(import and export) data to cloud storage buckets but not how to import the data back from cloud storage to firestore.

1

1 Answers

2
votes

To import to Project B the exported data of Project A you may use the gcloud firestore import command.

More specifically:

  1. Be sure to set the target project by using: gcloud config set [Project-B]

  2. Import the data from the source Cloud Storage bucket you used to host the exported data by using the gcloud firestore import command with the outputUrixPrefix:

    gcloud firestore import [outputUriPrefix]
    

Where outputUriPrefix is of the format:

gs://[SOURCE-BUCKET]/timestamp-of-export-operation

I tried myself the above, by following the documentation you shared about Moving data between projects.