/
Postgres Export/Import (Obsolete)

Postgres Export/Import (Obsolete)

The Postgres database for users is vital to backup since it not only controls access to accounts, but also objects will not properly appear in Hydra without the account that generated them for some reason as yet unknown.

To export use either:

pg_dump -U postgres chf_hydra -Fc > chf_hydra.dump  (dumps a postgres binary, PG restore has a number of options to handle recovering specific tables or data) (Recovery options besides full untested as of 1/27/16 D.S.)

pg_dump -U postgres chf_hydra -Fp > chf_hydra_dump.sql  (dumps a text file with SQL statements to generate the database, does not allow levels of recovery)


To import a backup copy:

In Postgres make a blank database chf_hydra

pg_restore -d chf_hydra -U postgres chf_hydra.dump
or
psql chf_hydra < chf_hydra_dump.sql


Then set permissions

psql -U postgres
GRANT Create,Connect,Temporary ON DATABASE chf_hydra TO chf_pg_hydra;

The postgres account password is in ansible-vault (groupvars/all)


Related content

Rebuilding production (Obsolete)
Rebuilding production (Obsolete)
More like this
Ansible post-Heroku
Ansible post-Heroku
More like this
Ruby Version upgrade (Obsolete)
Ruby Version upgrade (Obsolete)
More like this
Sync prod to staging
Sync prod to staging
More like this
Backups of the Digital Collections
Backups of the Digital Collections
More like this
export_archivesspace_xml
export_archivesspace_xml
More like this