1.  heroku keys  : to check keys on heroku account : optional step
  2. heroku keys:add path to public file name : optional step
  3. sshe-add path to pvt file name : optional step
  4. heroku addons:add pgbackups  : provision the backup addon
  5. heroku pgbackups:capture  : create / store the backup
  6. heroku pgbackups:url  : will get the url of the dump file
  7.  heroku pgbackups:url b004 where b004 is the dump file name given in response from 3rd step
  8. or else use direct  command : curl -o latest.dump `heroku pgbackups:url`
  9. IMport the dump into pg on localhost :
  10. pg_restore –verbose –clean –no-acl –no-owner -h 127.0.0.1 -p 5433 -U postgres -d dbname  latest.dump(dumpfile)
Import / Export pgsql db in Heroku

Leave a Reply

Your email address will not be published.