3
5

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 定期運用コマンド

Posted at

バックアップの状態確認

 heroku pg:backups --app sushi
=== Backups
ID    Backup Time                Status                              Size    Database
----  -------------------------  ----------------------------------  ------  --------
b013  2015-03-18 19:03:16 +0000  Running                                     IVORY
b011  2015-02-18 17:55:38 +0000  Finished 2015-02-18 17:55:39 +0000  1.9GB   IVORY
b010  2015-02-17 19:14:43 +0000  Finished 2015-02-17 19:14:48 +0000  1.9GB   IVORY
b004  2015-02-11 19:00:55 +0000  Finished 2015-02-17 19:14:48 +0000  1.9GB   IVORY

==== Restores
ID    Restore Time               Status                              Size    Database
----  -------------------------  ----------------------------------  ------  --------
r002  2015-03-16 17:33:19 +0000  Finished 2015-03-16 17:33:19 +0000  1.9GB   IVORY
r001  2015-03-15 12:13:44 +0000  Failed 2015-03-15 12:13:47 +0000    1.7GB   IVORY

スケジュールの状態確認は以下で

$ heroku pg:backups:schedules --app sushi
Current backup schedules:
RED: daily at 2:00 (America/Los_Angeles)

バックアップの作成

手動でのバックアップ作成は以下のコマンドで

$ heroku pg:backups:capture --app sushi

バックアップのリストア

以下のコマンドでリストアが可能

$ heroku pg:backups:restore b101 DATABASE_URL --app sushi

例えば本番バックアップを他のアプリに移す場合は以下のコマンドで

$ heroku pg:backups:restore sushi::b101 DATABASE_URL --app sushi-staging

出展

3
5
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
3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?