0
0

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 3 years have passed since last update.

Heroku Postgresql からデータをバックアップ

Last updated at Posted at 2020-05-06

バックアップをダウンロード(CLI)

Importing and Exporting Heroku Postgres Databases

heroku pg:backups:capture
heroku pg:backups:download

一行目でバックアップを作成し、二行目でダウンロードする。
これでコマンドを実行した階層と同じところにlatest.dumpというファイルがダウンロードされる

バックアップをダウンロード(管理画面)

バックアップを作成
Durability→Capture Backup
ダウンロード
Download

中身の確認方法

HerokuのPostgreSQLにログインしてSQLを直接実行する。
[PostgreSQL] よく使うコマンドまとめ

heroku pg:psql
機能 コマンド
テーブル一覧 \d
テーブルの構造の詳細を表示 \d TABLE_NAME
テーブルの中身を取得 SELECT * FROM テーブル名;
データベースから出る \q
データベース一覧表示 \l
ローカルでサーバーを立てる時 postgres -D /usr/local/var/postgres

参考

Heroku Postgres を利用してみよう

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?