How to backup/restore standalone heroku postgres d

2019-04-10 23:21发布

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.

I can create a dump using

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"

1条回答
Deceive 欺骗
2楼-- · 2019-04-11 00:04

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
查看更多
登录 后发表回答