Working with dumps#

Taking dumps comes in handy when you want to share a copy of your database with someone or if you’re going to keep it as a backup.

  • How can I take a dump of the database that I already have.

pg_dump -h mbandtweet.xxxxx.ca-central-1.rds.amazonaws.com --username=postgres -n import -f import.sql

Read more about how to take database dumps here.

  • How can you load these dumps to make your schema and tables ready? (You want to know how to do this for your worksheet and assignment)

psql -h HOST_NAME -U USER_NAME DATABASE < PATH_TO_THE_.sql_DUMP_FILE

psql -h mbandtweet.xxxx.us-west-2.rds.amazonaws.com -U postgres postgres < import.sql