Restore a deleted dump in RDS

I know how to restore a pg dump to an RDS database if this dump is on my machine, but how can I do this when the dump is available at a remote location, say, Amazon S3?

I want to do something like this:

pg_restore -h somedomain.us-east-1.rds.amazonaws.com -p 5432 -d databasename -U username https://s3.amazonaws.com/database.dump

But of course, this leads to

pg_restore: [archiver] could not open input file "https://s3.amazonaws.com/database.dump"

Thank you for your help!

+4
source share
1 answer

If the file name is not specified, it pg_restorewill accept data from standard input ( doc ). So this will work:

wget -O - 'https://s3.amazonaws.com/database.dump' | pg_restore -h somedomain.us-east-1.rds.amazonaws.com -p 5432 -d databasename -U username

, RDS, DB (doc). , , S3, .

+2

Source: https://habr.com/ru/post/1618926/


All Articles