techgaun / heroku-pgdb-copy

A plain simple bash script to copy and setup heroku database to your local postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

heroku-pgdb-copy

A plain simple bash script to copy and setup heroku database to your local postgres

Usage

wget -O heroku-pgdb-copy https://github.com/techgaun/heroku-pgdb-copy/raw/master/heroku-pgdb-copy && chmod +x heroku-pgdb-copy
  • Pass HEROKU_APP and DATABASE_NAME as the variables. These are the required variables.
  • Optionally pass DB_USER and PGPASSWORD (defaults assumed by this script are postgres : postgres)
  • If you have multiple pg database or non-standard database url, you can pass HEROKU_DB_URL

Examples

$ HEROKU_APP=zego-stage DATABASE_NAME=zego-stage ./heroku-pgdb-copy

# custom database url
$ HEROKU_APP=zego-stage DATABASE_NAME=zego-stage HEROKU_DB_URL=HEROKU_POSTGRESQL_MAUVE_URL ./heroku-pgdb-copy

# custom pg user and password locally
$ HEROKU_APP=zego-stage DATABASE_NAME=zego-stage DB_USER=techgaun PGPASSWORD=hello123 ./heroku-pgdb-copy

About

A plain simple bash script to copy and setup heroku database to your local postgres

License:MIT License


Languages

Language:Shell 100.0%