Backup and restore
What to protect
Section titled “What to protect”hapi-postgres-data/: authoritative FHIR database.kong-postgres-data/: gateway configuration, consumers, and credentials.hapi-data/,workingdir/, andhealthtag/: application data and transformer state.- Environment files and deployment manifests: store in an encrypted secret/configuration system.
kong-ssl/: protect the private key separately with tightly controlled access.
Do not treat a live filesystem copy of PostgreSQL data directories as a consistent database backup. Use PostgreSQL-native logical or physical backup procedures appropriate to the recovery objective.
Backup procedure
Section titled “Backup procedure”- Record source revision, image digests, database versions, and backup time.
- Use
pg_dump/pg_dumpallor an approved PostgreSQL backup tool for both databases. - Back up bind-mounted application directories and encrypted configuration separately.
- Encrypt backup media, restrict access, and verify checksums.
- Restore into an isolated environment regularly and run installation verification.
Restore order
Section titled “Restore order”- Stop application traffic and preserve the failed state for investigation.
- Restore HAPI and Kong databases into compatible PostgreSQL versions.
- Restore application directories, certificates, and configuration.
- Start databases, then Kong migration/gateway, HAPI, transformer, and API.
- Verify metadata, routes, authentication, and a non-production test patient before reopening traffic.
Document retention, recovery point objective, and recovery time objective in the hospital’s operational policy; they cannot be inferred from this repository.

