Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy data from AWS S3 to Aurora Postgres

I'm trying to copy data from AWS S3 to Aurora Postgres. Currently my process is as follows:

  1. Download files from S3 locally (on EC2 instance)
  2. Run "COPY FROM STDIN ... " command to load data from input stream to Aurora postgres.

I'm wondering if there is a command to copy directly from S3 to Aurora postgres.

like image 852
tamjd1 Avatar asked Mar 31 '17 20:03

tamjd1


People also ask

Can Postgres read from S3?

Your database must be running PostgreSQL version 10.7 or higher to import from Amazon S3 into RDS for PostgreSQL. If you don't have data stored on Amazon S3, you need to first create a bucket and store the data. For more information, see the following topics in the Amazon Simple Storage Service User Guide.

How do you transfer data from AWS redshift to Aurora PostgreSQL?

Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/ . Choose Snapshots. On the Snapshots page, choose the RDS for PostgreSQL snapshot that you want to migrate into an Aurora PostgreSQL DB cluster. Choose Actions then choose Migrate snapshot.


1 Answers

This blog post from AWS mentions being able to do it with AWS Database Migration service

https://aws.amazon.com/blogs/database/stream-data-into-an-aurora-postgresql-database-using-aws-dms-and-amazon-kinesis-data-firehose/

AWS DMS can read data from source S3 buckets and load them into a target database. To do this, provide access to an S3 bucket containing one or more data files. In that S3 bucket, include a JSON file that describes the mapping between the data and the database tables of the data in those files.

The source data files must be in comma-separated value (CSV) format. Name the files using the naming convention shown following. In this convention, schemaName is the source schema and tableName is the name of a table within that schema.

like image 81
strongjz Avatar answered Oct 18 '22 16:10

strongjz