はDB GRES:
1. heroku config
It will show current database URL
HEROKU_POSTGRESQL_COPPER_URL: postgres://xxxddxxdx:[email protected]:5432/xdfdsxdxxxx
HEROKU_POSTGRESQL_SILVER_URL: postgres://fasdfsad:[email protected]:5432/sdfasdfdasfds
//Default database set
DATABASE_URL: postgres://fasdfsad:[email protected]:5432/dsfsdf
//コマンドから新しいデータベースを追加するが、私はそれがサーバリソースセクションに移動して、編集アドオンをクリックして、pgsqlの追加および必要な計画に無料から飛行機を変えるのrcommandます。
2. heroku addons:create heroku-postgresql:hobby-basic
//Prevent new database updates
3. heroku maintenance:on
//Also off worker type dyno
heroku ps:scale worker=0
新しいDBへのコピー現在のデシベル
4. heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_COPPER_URL --app prod-test
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_COPPER_URL --app prod-test
Note:
DATABASE_URL = It is config veriable which point default current db
HEROKU_POSTGRESQL_COPPER_URL = This is config variable for which db I just created
prod-test = It is my APP name
5. Promote new database (Make new db as default db)
heroku pg:promote HEROKU_POSTGRESQL_COPPER_URL
6. Re-enable worker dyno
heroku ps:scale worker=1
heroku maintenance:off
7. remove old database
heroku addons:remove HEROKU_POSTGRESQL_SILVER_URL
ありがとう!今私はグーグルで吸うために馬鹿だと感じる。 –