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

Alb*_*dra 2 postgresql heroku

我已经创建了本地数据库的postgresql转储,但它包含敏感数据.我不想按照Heroku (导出和导入数据)状态的说明在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
Run Code Online (Sandbox Code Playgroud)

如果我在Amazon S3中公开转储,它就可以了.

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

Joh*_*non 5

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