Open SilinPavel opened 1 month ago
cp-api-srv
, cp-search-srv
cp-clair
and cp-notifier
podsThis dump should be done with the same postgres version as current one, to be able to restore db in case of corruption.
Don't forget to change placeholders with real values (default: cp-api-db.default.svc.cluster.local)
- Create dump
pg_dump -U pipeline -h <internal-dns-db-name> --password pipeline > pipeline-db-backup.sql
It is very important to create dump of the existing
db
bypg_dump
version that should match with a version of new postgres deployment (e.g. 16.4). For example by launching docker with postgres:16.4 to do the dump.Don't forget to change placeholders with real values (default: cp-api-db.default.svc.cluster.local)
- Create dump
pg_dump -U pipeline -h <internal-dns-db-name> --password pipeline > pipeline-db-dump.sql
- Wait process completion
- Save dump file somewhere safe and accessible
cp-api-db
deployment with postgresql 16.4!!! Don't forget to change volume dir on step (4) to have all data for new db separately !!!
/opt/postgresql-16/data
cp-api-db
deploypostgres:16.4
pgdata
from /opt/postgresql/data
to /opt/postgresql-16/data
cp-api-db
deploymentPrepare users and databases:
psql -U postgres
CREATE EXTENSION IF NOT EXISTS pg_trgm;
Create database and user for pipeline:
Don't forget to change placeholders with real values
psql -U postgres CREATE USER pipeline CREATEDB; ALTER USER pipeline WITH SUPERUSER; ALTER USER pipeline WITH PASSWORD '<password>'; CREATE DATABASE pipeline OWNER pipeline;
Create database and user for clair:
Don't forget to change placeholders with real values
psql -U postgres CREATE USER clair CREATEDB; ALTER USER clair WITH SUPERUSER; ALTER USER clair WITH PASSWORD '<password>'; CREATE DATABASE clair OWNER clair;
Apply dump (this operation takes a long time):
psql -U pipeline -d pipeline < /path-to-dump/pipeline-db-dump.sql
Wait for process completion
cp-clair
deploymentquay.io/lifescience/cloud-pipeline:clair-v4-<version>
readinessProbe/path
to /healthzreplicas
in cp-api-srv
, cp-search-srv
cp-clair
and cp-notifier
deployments back
Background It would be great to update our main DB to the latest stable version (PostgreSQL 16.4)
Approach
cp-api-db
deployment image to the postgres:16.4cp-api-srv
JDBC driver to the latest version (42.7.3
) which will support both postgres versions (9.6, 16.4)