PRIMAVERA-H2020 / primavera-dmt

PRIMAVERA Data Management Tool
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Instructions for dumping and reloading the DB #342

Closed agstephens closed 3 years ago

agstephens commented 3 years ago

Dump the old DB and copy the new server

On prima-dm as root:

scl enable rh-postgresql96 bash
pg_dump -U primavera -f /usr/local/db-backups/testdb.sql primavera_prod
gzip /usr/local/db-backups/testdb.sql

Create target dir on prima-dm1:

mkdir /usr/local/db-backups

Loading into new DB

On old server:

scp /usr/local/db-backups/testdb.sql.gz prima-dm1.jasmin.ac.uk:/usr/local/db-backups/

On new server prima-dm1:

sudo su postgres
psql primavera_prod

primavera_prod=# alter role primavera with password '<NEW_PASSWORD>';
ALTER ROLE

Then load it:

cat /usr/local/db-backups/testdb.sql.gz | gunzip | psql -U primavera primavera_prod
jonseddon commented 3 years ago

Depends on #344

agstephens commented 3 years ago

Has been run on the new system.