Skip to content

Conversation

@DerekRoberts
Copy link
Member

@DerekRoberts DerekRoberts commented Jul 2, 2025

Originally created for nr-fom postgres migrations.

./rename_deployment.sh <source-deployment-name> [target-deployment-name]

  • exports a deployment manifest
  • deletes fields (status, some metadata)
  • modifies deployment (name, labels)
  • redeploys the renamed deployment
  • watches rollout to completion/failure
  • deletes the old deployment, maintains its pvc

./db_transfer.sh <source-deployment-name> <target-deployment-name>

  • verifies that source PVC is older than destination PVC (allows override)
  • streams pg_dump to pr_restore between postgres containers
  • excludes postgis schemas (tiger, tiger_data, topology)

Steps:

# 1. Scale down stack
# Use web console

# 2. Rename the old db
./rename_deployment.sh fom-test-db

# 3. Deploy the new db
oc process -f openshift.deploy.yml -p ZONE=test -p TAG=test | oc apply -f -

# 4. Stream dump from old to new db
./db_transfer.sh fom-test-db-prev fom-test-db

# 5. Scale up stack
# Use web console

Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

Copilot AI review requested due to automatic review settings July 2, 2025 19:39

This comment was marked as outdated.

DerekRoberts and others added 3 commits July 2, 2025 13:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DerekRoberts DerekRoberts requested a review from Copilot July 2, 2025 21:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds two helper scripts for OpenShift deployment management and updates the README with their usage.

  • Introduces rename_deployment.sh to export, rename, and reapply deployments
  • Introduces db_transfer.sh to stream a PostgreSQL dump from one deployment to another
  • Updates README.md with instructions for the new scripts

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
oc_scripts/rename_deployment.sh New script to rename an OpenShift deployment manifest
oc_scripts/db_transfer.sh New script to transfer a Postgres dump between pods
README.md Added usage documentation for the new scripts

@DerekRoberts DerekRoberts self-assigned this Jul 2, 2025
@DerekRoberts DerekRoberts moved this from New to Active in DevOps (NR) Jul 2, 2025
Copy link
Collaborator

@cberg-aot cberg-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@github-project-automation github-project-automation bot moved this from Active to Waiting in DevOps (NR) Jul 3, 2025
@DerekRoberts DerekRoberts merged commit d9b3d32 into main Jul 3, 2025
26 of 27 checks passed
@DerekRoberts DerekRoberts deleted the feat/scripts branch July 3, 2025 04:26
@github-project-automation github-project-automation bot moved this from Waiting to Done in DevOps (NR) Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants