Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting data from Google Cloud Storage to Amazon S3

I would like to transfer data from a table in BigQuery, into another one in Redshift. My planned data flow is as follows:

BigQuery -> Google Cloud Storage -> Amazon S3 -> Redshift

I know about Google Cloud Storage Transfer Service, but I'm not sure it can help me. From Google Cloud documentation:

Cloud Storage Transfer Service

This page describes Cloud Storage Transfer Service, which you can use to quickly import online data into Google Cloud Storage.

I understand that this service can be used to import data into Google Cloud Storage and not to export from it.

Is there a way I can export data from Google Cloud Storage to Amazon S3?

like image 211
Onca Avatar asked Sep 05 '16 11:09

Onca


People also ask

Is Google cloud storage compatible with S3?

XML API. The Cloud Storage XML API is interoperable with some tools and libraries that work with services such as Amazon Simple Storage Service (Amazon S3).

How do I transfer files from Google Drive to S3 bucket?

Go to the "Cloud Transfer" section, click "FROM" and "TO" to select Google Drive and Amazon S3 as the source and destination respectively. Then click "Transfer Now" to start the transfer task.

Can I use S3 instead of Google Drive?

From these comparisons of AWS S3 vs Google Drive, our recommendation is that if you are a large enterprise or a medium-sized enterprise that needs to manage a lot of data, you can choose Amazon S3 as your cloud drive. As we know from the pricing that the more space You use in Amazon S3, the more affordable it is.


2 Answers

You can use gsutil to copy data from a Google Cloud Storage bucket to an Amazon bucket, using a command such as:

gsutil -m rsync -rd gs://your-gcs-bucket s3://your-s3-bucket 

Note that the -d option above will cause gsutil rsync to delete objects from your S3 bucket that aren't present in your GCS bucket (in addition to adding new objects). You can leave off that option if you just want to add new objects from your GCS to your S3 bucket.

like image 103
Mike Schwartz Avatar answered Sep 22 '22 16:09

Mike Schwartz


Go to any instance or cloud shell in GCP

First of all configure your AWS credentials in your GCP

aws configure

if this is not recognising the install AWS CLI follow this guide https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html

follow this URL for AWS configure https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html

Attaching my screenshot

enter image description here

Then using gsutil

gsutil -m rsync -rd gs://storagename s3://bucketname

enter image description here enter image description here

16GB data transferred in some minutes

like image 38
Nursnaaz Avatar answered Sep 22 '22 16:09

Nursnaaz