# Persistent Flyway Migration Issues After Data Migration in DHIS2

**URL:** <https://community.dhis2.org/t/persistent-flyway-migration-issues-after-data-migration-in-dhis2/57760>\
**Category:** Support - Assistance technique\
**Created:** [20 March 2024 14:53 UTC](https://community.dhis2.org/t/persistent-flyway-migration-issues-after-data-migration-in-dhis2/57760 "2024-03-20T14:53:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simardeep\_Singh](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/simardeep_singh/32/40226_2.png) [@Simardeep\_Singh](https://community.dhis2.org/u/Simardeep_Singh)\
**Post date:** [20 March 2024 14:53 UTC](https://community.dhis2.org/t/persistent-flyway-migration-issues-after-data-migration-in-dhis2/57760/1 "2024-03-20T14:53:07Z")

</div>

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](https://community.dhis2.org/groups/dhis2-backend) - DHIS2 Backend Dev Team  
[@dhis2-platform](https://community.dhis2.org/groups/dhis2-platform) - DHIS2 Apps Dev Team

---

<div class="post-metadata">

**Author:** ![ivo](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ivo/32/37426_2.png) [@ivo](https://community.dhis2.org/u/ivo)\
**Post date:** [22 March 2024 07:41 UTC](https://community.dhis2.org/t/persistent-flyway-migration-issues-after-data-migration-in-dhis2/57760/2 "2024-03-22T07:41:44Z")

</div>

Hi,

just to clarify. Reading

> [@Simardeep\_Singh](#):
>
> After migrating data from a development environment to production

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?
