Restore a remote dump to RDS

前端 未结 1 1709
南旧
南旧 2020-12-17 00:35

I know how to restore a pg dump into a RDS database if that dump is in my machine, but how could I do it when the dump is available at a remote location, say Amazon S3?

相关标签:
1条回答
  • 2020-12-17 01:11

    If a filename is not specified, pg_restore will take data from standard input (doc). So, this would 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

    Note that you can create an RDS snapshot, then create a new DB instance from that snapshot (doc). In your particular situation, I don't know if that would work better than backing up to S3, but it's worth mentioning.

    0 讨论(0)
提交回复
热议问题