Export
heroku pg:backups capture
curl -o latest.dump `heroku pg:backups public-url`
Import
heroku pg:backups capture
heroku pg:backups restore 'http://example. herokuapp.com/latest.dump' DATABASE_URL
Export specific Table Heroku
pg_dump --no-acl --no-owner -h ec2-ip.compute-. amazonaws.com -U mdvxormgnpnmne -t events --data-only d3irvpu7la5kcd > events1.dump
Import specific Table Heroku
psql -U postgres -d event-kit_development -f events1.dump
Export Db: heroku pg:backups capture
curl -o latest.dump `heroku pg:backups public-url`
Import
heroku pg:backups capture
heroku pg:backups restore 'http://example.
Export specific Table Heroku
pg_dump --no-acl --no-owner -h ec2-ip.compute-.
Import specific Table Heroku
psql -U postgres -d event-kit_development -f events1.dump
pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}
Import Db:
psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
Dump only contents of db:
backup:
pg_dump -Fc -v -f full.dump -U postgres dbname
restore:
pg_restore -a -U postgres -d event-kit_development -Fc full.dump
pg_dumpall -g -U postgres > globals.sql
Dump schema of database:
pg_dump -Fp -s -v -f db-schema.sql -U postgres dbname
Dump contents of database:
pg_dump -Fc -v -f full.dump -U postgres dbname
Now restore.
psql -f globals.sql
psql -f db-schema.sql dbname
pg_restore -a -d dbname -Fc full.dump