Transferring Files Between Different Projects In Cloud Storage Buckets

Steps to create Bucket in project1.

  1. Go to Google Cloud Console and log in with credentials.

  2. Search Cloud Storage>Buckets in My First Project .

  3. In the Buckets page, click the "Create" button.

  4. Name the Bucket.

    • Bucket names must be unique globally(Ex- bucket_aaa_p1 ).

  5. Choose Storage Location.

    • Multi-region: Store data across multiple regions (Ex-asia).

    • Dual-region: Store data in two regions for higher availability.

    • Region: Store data in a single region.

  6. Select Default Storage Class as required.

    • Standard: For frequently accessed data.

    • Nearline: For data accessed less than once a month.

    • Coldline: For data accessed less than once a quarter.

    • Archive: For rarely accessed data (once a year or less).

  7. Set Access Control.

    • Fine-grained: Use Identity and Access Management (IAM) for detailed control.

    • Uniform: Simplified bucket-level permissions.

  8. Click Create for bucket creation.

  9. Click bucket to upload the file.

  10. On the bucket's details page, click the "UPLOAD>Upload Files" button.

Once the upload is complete, the file(s) will be listed in the bucket.


Steps to create Bucket in project2.

  1. Use similar step to create bucket in New Project 0522.

  2. Name bucket as bucket_bbb_p2.

On the Buckets page, we’ll see storage bucket in available New Project 0522.


Steps to transfer files from one project to another.

  1. Go to Cloud Storage>Buckets, click on bucket_aaa_p1 in My First Project.

  2. Click on TRANSFER DATA>Transfer data out.

  3. Now create a transfer job, add Source type and Destination type.

  4. Choose a source bucket or folder( bucket_aaa_p1 ), add filter(Filter by prefix, Filter by last modified date) to include or exclude object/files.

  5. Choose a destination bucket, click on BROWSE.

  6. Change Project ID to New Project 0522, select Buckets>bucket_bbb_p2.

  7. Choose when to run job.

  8. Choose other settings also.

  9. Click CREATE, to create a job.

  10. A pop-up will appear to monitor job.

  11. Click on GO TO JOB to see job details.

  12. In OPERATIONS we see all activity and logs.

  13. To validate file transfer, go to bucket_bbb_p2 in New Project 0522.

Here we can see all transferred file.


Best method to transfer large number of file

  1. open cloud shell.

  2. Write command to list objects of bucket_aaa_p1.

     gsutil ls gs://bucket_aaa_p1/
    

  3. Write command to copy object from bucket_aaa_p1 to bucket_bbb_p2.

     gsutil cp gs://bucket_aaa_p1/* gs://bucket_bbb_p2/
    

  4. write command to see transferred file in bucket_bbb_p2.

     gsutil ls gs://bucket_bbb_p2/