LoginSignup
0
0

More than 5 years have passed since last update.

herokuのpostgresをローカルにRestoreする

Last updated at Posted at 2017-11-14

herokuのpostgresデータをダウンロード

.dumpファイルとしてダウンロード。

Screen Shot 2017-11-14 at 18.49.57.png

実際はアプリ名を入れて

heroku pg:backups:capture --app [appのname]
heroku pg:backups:download --app [appのname]

ローカルにRestore

Screen Shot 2017-11-14 at 18.50.09.png

以下、コマンドを実行。
-h とかは.envファイルに書いてあるローカルDBの情報に置き換える。
(今回はVagrantを使用しているのでVagrant内で実行)

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
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