Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

heroku upload local database

# For Postgres / psql
pg_dump --verbose -F c -Z 0 -U postgres -h localhost -p 5432 yourdbname > local.dump # Save local database to file
heroku pg:reset DATABASE # Reset must occur before upload
heroku config:get DATABASE_URL #postgres:// username : password @ hostname : port / databasename
pg_restore --verbose --no-acl --no-owner -U username -h hostname -p 5432 -d databasename < local.dump
# Enter DATABASE_URL password when prompted
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #heroku #upload #local #database
ADD COMMENT
Topic
Name
1+8 =