Skip to content

Manual Syncing of DEV to TEST to PROD

Derek Roberts edited this page Jul 17, 2018 · 2 revisions

In the case where the Django migrations are out-of-sync, it will be necessary to:

a) deploy to the lower environment (e.g DEV) successfully, and export that DB (simplest to do on the postgres pod, as opposed to the gwells pod). Wait at the "Deploy to <>' Jenkins GUI prompt.

pg_dump -d gwells -U userGN0 -Fc --no-privileges --no-tablespaces --schema=public > gwells-dev-recover.dmp

b) rsync that *.dmp file to the local machine

oc rsync postgresql-47-t7xmr:/tmp/recover/ .

c) rsync that *.dmp file to the higher environment (e.g. TEST). Again, the postgres pod is simplest.

oc rsync recover postgresql-12-m3941:/tmp

d) scale down the gwells application server pod (to avoid exclusive locks and to lock out users) via the OpenShift console

e) restore the DB into the higher environment

pg_restore -d gwells --no-owner --no-privileges -U userXMW gwells-test.dmp

f) Proceed with the 'Deploy to <>' on the Jenkins GUI Console

g) scale up the gwells application server pod via the OpenShift console

Clone this wiki locally