zipperer / migrate_database_with_michael

0 stars 0 forks source link

Perform backup and restore #23

Closed zipperer closed 10 months ago

zipperer commented 10 months ago

Adapt instructions from pg_dump documentation

To dump a database called mydb into an SQL-script file:

$ pg_dump mydb > db.sql
To reload such a script into a (freshly created) database named newdb:

$ psql -d newdb -f db.sql

to our case.

zipperer commented 10 months ago

We did this during #3 .

$ pg_dump grace_and_truth_db > example_dump.sql

$ psql --username postgres --dbname postgres
psql> CREATE DATABASE restore_db;
psql> \q
$ psql -d restore_db -f example_dump.sql
<look at contents of restore_db>