如何在AWS上备份Postgres数据库并在本地还原?

发布于 2025-02-06 03:57:49 字数 224 浏览 4 评论 0原文

我正在尝试使用一些模拟数据来设置我的本地数据库。我们有一个带有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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倦话 2025-02-13 03:57:49

恐怕您拥有的唯一机会是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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文