FIRESTORE - Import failed

Hello!

I was trying to import some data from a firestore collection to another. In order to achieve this, I used the export feature in project1. Now, I'm inside my project2 trying to do import but with no luck. Here are some screenshots. Am I doing something wrong? 

Screenshot 2024-05-02 at 14.24.21.png

Import screenshot 1Import screenshot 1

 

 

 

Import screenshot 2Import screenshot 2

 

 

Error screenshotError screenshot

 

--
Best regards
David Regalado
Web | Linkedin | Cloudskillsboost

1 1 58
1 REPLY 1

The error message specifies the path to the file as /boozeco-evidente-test-david/boozeco-evidente-test-david.overall_export_metadata, which seems to be missing or incorrectly specified. Here's a step-by-step approach to troubleshoot this issue:

  1. Verify File Existence: Ensure that the file actually exists in the specified location in your Google Cloud Storage bucket. You can check this using the Google Cloud Console or via the Cloud Shell with the command:

    gsutil ls gs://boozeco-evidente-test-david/

    This command lists all files in the bucket. Look specifically for the file named boozeco-evidente-test-david.overall_export_metadata.

  2. Check Path in Import Command: Ensure that the path specified in your import command is correct. Based on your message, the path seems to be duplicated (/boozeco-evidente-test-david/boozeco-evidente-test-david.overall_export_metadata). Make sure that the path you use matches exactly with where the file is located in the storage bucket.

  3. Use Full Path in Commands: When referencing your file in commands, use the full path from the bucket root, and ensure there are no typographical errors:

    gsutil ls gs://boozeco-evidente-test-david/firestore-exports/

    This can help you verify the file's presence and exact location within subdirectories.

  4. Correct Command Format: When importing to Firestore, ensure your command is correctly formatted. Generally, the command to import data from a Google Cloud Storage bucket to Firestore looks like this:

    gcloud firestore import gs://[BUCKET_NAME]/[PATH_TO_EXPORTED_DATA]

    Replace [BUCKET_NAME] and [PATH_TO_EXPORTED_DATA] with your bucket name and the path to the folder containing your Firestore export.

  5. Permissions and Access: Verify that your Google Cloud account has the necessary permissions to access the Google Cloud Storage bucket and perform import operations in Firestore.