如何备份/恢复独立的heroku postgres数据库? [英] How to backup/restore standalone heroku postgres database?

查看:179
本文介绍了如何备份/恢复独立的heroku postgres数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https:// 备份/恢复独立postgres数据库是否存在 Heroku 除了使用 pg_dump / pg_restore 之外,还可以使用postgres.heroku.com/ 。该数据库不附加到任何应用程序。

Is there a Heroku way to backup / restore a standalone postgres database at https://postgres.heroku.com/ apart from using pg_dump / pg_restore ? The database is not attached to any app.

我可以使用

pg_dump --verbose -F c -b -h hostname -p port -U username -f "backup.dump" database_name

并使用

and restore it using

pg_restore --verbose --clean --no-acl --no-owner -h hostname -p port -U username -d database_name "backup.dump"


推荐答案

当您创建新数据库时,heroku会自动为您创建一个应用程序。使用> heroku list 来检查它。因此,您可以使用空的应用程序进行恢复。

Looks when you create a new database, heroku automatically creates an app for you. Check it with heroku list So you can restore using the empty app.

heroku pgbackups:restore DATABASE 'dumped-db-secure-url' --app heroku-postgres-xxx

这篇关于如何备份/恢复独立的heroku postgres数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆