6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Heroku Postgres Upgrade

Posted at

Heroku Postgresアップグレード

DB情報確認

heroku pg:info

アップグレード

  • 新プランDB作成
heroku addons:add heroku-postgresql:standard-yanari
  • 新しいDBができるまで待つ
heroku pg:wait
----------
Waiting for database HEROKU_POSTGRESQL_COPPER_URL... available
----------
  • メンテナンスON

※サイト停止

heroku maintenance:on

※workerがある場合のみ

heroku ps:scale worker=0
  • 最新のDBの状態をバックアップとして取得
heroku pgbackups:capture --expire
  • バックアップからDB状態をコピー
heroku pgbackups:restore HEROKU_POSTGRESQL_COPPER_URL
  • 新しいDBに繋ぎ変え
heroku pg:promote HEROKU_POSTGRESQL_COPPER_URL
  • メンテナンスOFF
heroku maintenance:off

※workerがある場合のみ

heroku ps:scale worker=1
  • DB情報確認
heroku pg:info
----------
=== HEROKU_POSTGRESQL_COPPER_URL (DATABASE_URL)
Plan:        Standard Yanari
Status:      Available
Data Size:   6.4 MB
Tables:      0
PG Version:  9.3.2
Connections: 3
Fork/Follow: Temporarily Unavailable
Rollback:    Temporarily Unavailable
Created:     2014-01-15 05:40 UTC
Maintenance: not required

=== HEROKU_POSTGRESQL_CRIMSON_URL
Plan:        Hobby-dev
Status:      available
Connections: 2
PG Version:  9.3.2
Created:     2014-01-08 05:26 UTC
Data Size:   6.7 MB
Tables:      5
Rows:        0/10000 (In compliance)
Fork/Follow: Unsupported
Rollback:    Unsupported
----------

旧DB削除

heroku addons:remove HEROKU_POSTGRESQL_CRIMSON_URL
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?