-
Notifications
You must be signed in to change notification settings - Fork 40
Create staging database
Kuan Fan edited this page Jun 4, 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 mountpostgresql-backup-cns to it
- Use the secret tfrs-postgresql-staging for environment variable
- oc rsync [local drive] [pod name]:[path to the dump file]
- 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/tfrs-[DateTime].gz | psql tfrs'