-
Notifications
You must be signed in to change notification settings - Fork 40
Create staging database
Kuan Fan edited this page Sep 19, 2018
·
11 revisions
- Login prod postgresql pod and run command "pg_dump tfrs | gzip > /postgresql-backup/SQLDump/prod/tfrs-[DateTime].gz"
- Copy the above database dump to local drive "oc rsync [pod name]:[path to the dump file] [local drive]"
- Create secret tfrs-postgresql-staging which contains same content as prod secret tfrs-postgresql
- Create postgresql-staging-cns storage
- Create DC/postgresql-staging and mount postgresql-backup-cns to it
- Use the secret tfrs-postgresql-staging for environment variable
- oc rsync [local drive] [pod name]:/postgresql-backup/SQLDump/prod
- Test either has same release deployed as prod, or one or a couple ahead.
- If we don't run deployment on test, only duplicate prod database to test, there should be no migration happening.
- Further verification may be needed.
- psql tfrs
- #DROP SCHEMA public CASCADE;
- #CREATE SCHEMA public;
- #GRANT ALL ON SCHEMA public TO postgres;
- #GRANT ALL ON SCHEMA public TO public;
- quit psql
- run command 'gunzip -c /postgresql-backup/SQLDump/prod/tfrs-[DateTime].gz | psql tfrs'