feat: Differential backup implementation#243
Merged
adskyiproger merged 6 commits intodevelopfrom Feb 26, 2026
Merged
Conversation
eac23c0 to
be3d34b
Compare
4f7b47d to
57cf7aa
Compare
adskyiproger
commented
Feb 18, 2026
infrastructure/environments/templates/charts-values/opencrvs-services/values.yaml
Outdated
Show resolved
Hide resolved
42aa1f2 to
efcf776
Compare
Collaborator
Author
|
Please check this one as well @oni-on1003 |
227d7cf to
c3ccf31
Compare
48c1666 to
db2715a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Terminology, see backup definition at: https://pgbackrest.org/user-guide.html#concept/backup
DON'T be confused with DUMP and FULL backup: https://www.postgresql.org/docs/current/backup-dump.html.
Dump backup is particular database backup, not instance (cluster) backup.
Considerations for partial backup/restore:
dump. Fulleventsdatabase dump will be taken by default. Operator will have an option to change backup type fromdumptodifferentialby runningenvironment:initscript or by changing value in GitHub environment variable.incrementalbackup strategy is not as straight forward asdifferentialand gives more space for human-error, e/g incremental backups should be specified in right order while restore.incrementalare a bit beneficial in terms of disk space usage, since only diff between previous incremental backup is taken, but since CRVS records are growing linearly, there is no need to take care about this kind of optimisation. We preferdifferentialoverincremental.Testing
environment:init script
Configuration question

Summary screen
Workflow execution
Get postgres admin password from production environment:

Secret is stored in

$env_fileand later transferred to k8s secretpostgres-admin-user:Helm deploy to production
Before running deployment modify values.yaml:
Add following lines:
Deploy modified configuration:
Verify cronjob was created:
Backup testing
Create job to test full backup is working properly:
Create job to test diff backup is working properly:
Verify jobs were created:
Verify backups were created:
k exec -it postgres-0 -- bashpgbackrest --stanza=main infoDeploy to staging
Before running deployment modify values.yaml:
Add following lines:
Deploy modified configuration:
Verify restore cronjob was created:
NOTE: Cronjob name for both restore types (dump, pgbackrest) are the same.
Restore testing
Wait up to 24h or create restore job manually:
Output:
Check logs:
Output:
Check data consistency:

OpenCRVS on restore cronjob
Manual verification steps
Create values file:
Update values file:
Upgrade helm release:
Create job from cronjob:
Check logs:
Logs: