我需要将db从app_1传输到app_2
我在app_1上创建了备份
然后跑了:
heroku pg:backups还原HEROKU_POSTGRESQL_COLOR --app app_2 heroku pgbackups:url --app app_1
HEROKU_POSTGRESQL_COLOR = app_2的数据库网址
然后我得到:
! `pg:backups` is not a heroku command.
! Perhaps you meant `pgbackups`.
! See `heroku help` for a list of available commands.
Run Code Online (Sandbox Code Playgroud)
所以我跑了:
heroku pgbackups:恢复HEROKU_POSTGRESQL_COLOR --app app_2 heroku pgbackups:url --app app_1
然后我得到以下内容:
! WARNING: Destructive Action
! This command will affect the app: app_2
! To proceed, type "app_2" or re-run this command with --confirm app_2
Run Code Online (Sandbox Code Playgroud)
所以我确认:
> app_2
! Please add the pgbackups addon …Run Code Online (Sandbox Code Playgroud) 我正在尝试将本地 Postgresql 数据库导入 Heroku,我正在按照以下步骤操作https://devcenter.heroku.com/articles/heroku-postgres-import-export#import-to-heroku-postgres。
我已经成功:
heroku pg:backups:restore '<SIGNED URL>' DATABASE_URL(添加 -a 与我的应用程序名称)。恢复备份的过程正确启动,但随后以以下代码退出:
! An error occurred and the backup did not finish.
!
! Could not initialize transfer
!
! Run heroku pg:backups:info r011 for more details.
Run Code Online (Sandbox Code Playgroud)
打开日志显示:
Database: BACKUP
Finished at: 2020-01-09 18:49:30 +0000
Status: Failed
Type: Manual
Backup Size: 0.00B (0% compression)
=== Backup Logs
2020-01-09 18:49:30 +0000 Could not initialize transfer
Run Code Online (Sandbox Code Playgroud)
我试过了:
postgresql heroku amazon-s3 amazon-web-services heroku-postgres