Search code examples
ruby-on-rails-3postgresqlherokudatabase-migration

Using Heroku Postgres database locally in a Rails 3 app


I have downloaded the database from an existing Heroku app onto my local machine. The data I downloaded is in a single file; let's call it herokuapp.db. I also have Postgres installed and I can successfully create a new Postgres database and have my Rails app reference that. What I want to do is move the data I downloaded from Heroku into this database or create a new Postgres database using the downloaded data.


Solution

  • Use pg_restore --verbose --clean --no-acl --no-owner -d [database_name] [herokuapp.db] see https://devcenter.heroku.com/articles/export-from-heroku-postgres for more information