# Postgres database restore via dumps

Create the database dump (you'll be prompted for the password)

`pg_dump -U<DB_USER> -h<DB_HOST> <DB_NAME> > dumpfile`

Copy over the dump file to the new machine that has postgresql installed

Recreate the DB or drop individual tables

Apply the dump

`psql -U<DB_USER> -h<DB_HOST> -d <DB_NAME> < dumpfile`

> The dumpfile might need to be altered to be ingested into a higher versioned DB
