如何在AWS上备份Postgres数据库并在本地还原?
我正在尝试使用一些模拟数据来设置我的本地数据库。我们有一个带有Postgres数据库的开发AWS帐户。我想创建它的备份,将其导出到本地计算机,然后还原到我本地的Postgres数据库。
我一直在尝试在网上找到此操作,但是我发现的一切都在如何备份到AWS并恢复AWS。我尝试创建快照并通过S3导出它 - 但是该快照不会像我期望的那样从从中恢复的SQL文件。
如果有人可以将我指向正确的方向,我会非常感谢它:)
I'm working on trying to setup my local database with some mock data to work with. We have a development AWS account with a postgres database. I would like to create a backup of it, export it to my local computer, and restore to my local postgres database.
I've been trying to find how to do this online, but everything I'm finding is on how to backup to AWS and to restore back to AWS. I tried creating a snapshot and exporting it via S3 - but the snapshot doesn't produce a sql file to restore from like I was expecting.
If anyone can point me in the right direction I would very much appreciate it :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恐怕您拥有的唯一机会是
pg_dump
/pg_restore
。即使亚马逊让您可以接触到其文件系统备份,我怀疑它们对您而言可能几乎没有用,因为Amazon运行了PostgreSQL的修改版本,并且无法确定物理文件格式与PostgreSQL相同。
I am afraid that the only chance you have is
pg_dump
/pg_restore
.Even if Amazon lets you get your hands on its file system backups, which I doubt, they may be of little use to you, since Amazon runs modified versions of PostgreSQL and you cannot be sure that the physical file format is identical to PostgreSQL.