将本地postgresql转储导入heroku最安全的方法是什么?

时间:2012-12-13 08:37:18

标签: postgresql heroku

我已经创建了本地数据库的postgresql转储,但它包含敏感数据。我不想按照Heroku (Export & Import data)州的说明在Amazon S3中公开。

这就是我要恢复数据库的目的:

heroku pgbackups:restore HEROKU_POSTGRESQL_DB_URL 'https://s3.amazonaws.com/mylink/mydb.dump'

HEROKU_POSTGRESQL_DB_URL  <---restore---  mydb.dump

 !    WARNING: Destructive Action
 !    This command will affect the app: app-name
 !    To proceed, type "app-name" or re-run this command with --confirm app-name

> app-name

Retrieving... done

 !    An error occurred and your restore did not finish.
 !    The backup url is invalid. Use `pgbackups:url` to generate a new temporary URL

如果我在Amazon S3中公开转储,则可以。

有没有一种安全的方法可以将此转储导入Heroku的postgresql数据库?

1 个答案:

答案 0 :(得分:5)

通过PGAdmin等工具直接连接到Heroku数据库,并将其直接恢复到数据库中。使用heroku config的输出获取数据库URL以获取所需的凭据。

相关问题