Skip to content

Conversation

@tumbledwyer
Copy link
Contributor

Description

If a staging server is upgraded to v1.9, it adds postgres.
But since Prod will take a while to get upgraded, there will be a period where Staging has Postgres, while Prod does not.
So when Prod backs up to Staging, there will be no Postgres backup.

Currently, when staging attempts to restore, it wipes all dbs first and then attempts to restore.
The postgres restore will fail and all data will remain wiped.

This PR first check if a postgres backup exists before attempting to wipe or restore.

Fixes: opencrvs/opencrvs-core#10682

Link this pull request to the GitHub issue (and optionally name the branch ocrvs-<issue #>)

Checklist

  • I have linked the correct Github issue under "Development"
  • I have tested the changes locally, and written appropriate tests
  • I have tested beyond the happy path (e.g. edge cases, failure paths)
  • I have updated the changelog with this change (if applicable)
  • I have updated the GitHub issue status accordingly

This stops the restore from failing in a wiped state
@tumbledwyer tumbledwyer added this to the 1.9.0 milestone Oct 9, 2025
@tumbledwyer tumbledwyer moved this to In Code Review in OpenCRVS Core Oct 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

Copy link
Contributor

@cibelius cibelius left a comment

Choose a reason for hiding this comment

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

Nice 👍

@tumbledwyer tumbledwyer merged commit 48df126 into develop Oct 9, 2025
2 checks passed
@tumbledwyer tumbledwyer moved this from In Code Review to Ready for QA in OpenCRVS Core Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for QA

Development

Successfully merging this pull request may close these issues.

Backups from a v1.8 Prod will wipe all data on a v1.9 Staging

3 participants