Persistent Flyway Migration Issues After Data Migration in DHIS2

After migrating data from a development environment to production, I am encountering persistent issues with Flyway migrations in a DHIS2 instance deployed on Kubernetes (GCP). Despite following recommended steps and attempting repairs, the issues with migration checksum mismatches and unresolved migrations remain.

Environment:

  • DHIS2 Version: dhis2/core-dev:latest (Docker image deployed on Kubernetes in GCP)
  • Database Environment: PostGIS (CNPG) databases in both source and target environments
  • Flyway Version: 10.10.0 OSS Edition by Redgate

Steps to Reproduce:

  1. Exported data from the development CNPG PostGIS database.
  2. Imported data into the production CNPG PostGIS database.
  3. Attempted to connect to the production database through DHIS2 running in Kubernetes.
  4. Encountered connectivity issues preventing normal application operations.

Issue Details:

  1. Checksum Mismatch for Migration Version 2.41.2:
  • Applied to database: -662914890
  • Resolved locally: 391816887
  • Despite no alterations to the migration script post-application, a checksum mismatch is detected.
  1. Unresolved Migration for Version 2.41.46:
  • This version is flagged as applied in the database but not found locally. However, no such migration was intentionally removed.
  • Executed flyway repair with -outOfOrder=true and -validateOnMigrate=false options, expecting resolution of the checksum mismatch and reconciliation of the missing migration.
  • Reviewed migration scripts for version 2.41.2 to ensure no unintended changes were introduced.

Logs

Migration checksum mismatch for migration version 2.41.2
→ Applied to database : -662914890
→ Resolved locally : 391816887
Either revert the changes to the migration, or run repair to update the schema history.
Detected applied migration not resolved locally: 2.41.46.
If you removed this migration intentionally, run repair to mark the migration as deleted.

@dhis2-backend - DHIS2 Backend Dev Team
@dhis2-platform - DHIS2 Apps Dev Team

Hi,

just to clarify. Reading

and

  • DHIS2 Version: dhis2/core-dev:latest (Docker image deployed on Kubernetes in GCP)

dhis2/core-dev:latest has the latest development changes and is not a release and therefore not suited for production. Do you refer to your environment as production but use it for development purposes?

What is the DHIS2 version you exported the data from?