Migration from 2.40 to 2.41 not working

Hi all I hope you are all doing well, I need your support. I am unable to migrate my DHIS2 instance from any version of 2.40 to 2.41. I am currently running 2.40.10 and when I run the migration there is a flywaydb "Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V2_41_24__TrackedEntityInstanceToTrackedEntity.sql failed » and the error message is "Message : ERROR: relation “trackedentity” already exists » If I delete the relation another message comes and after that I am stucked. here is the screen capture Thank you for your support.

Hi @Malick
It seems you have a ran the migrations earlier which introduced the new table “trackedentity” already in your db. Did you already try the 2.41DB once before and failed?

Assuming you have a backup before you tried to migrate the first time. Could you try again with a backup 2.40 database?

Keep us updated
Regards
Ameen

1 Like

Hi I am not sure if I understand what you said very well. But We are currently running a 2.40 version database and yes we have some backups of that version. The error appears when whe try to do the migration from 2.40 to 2.41. Our databse is currently in 2.39 version. We can migrate to 2.40 till 2.40.10 we encounter an error sayinf 'Schema-validation: missing table [aggregatedataexchange] » but followinf this link « Error when upgrading from 2.39.8 to 2.39.9 - #4 by netroms » we can procede with success. The error "Message : ERROR: relation “trackedentity” already exists » only appears when we try to attend the 2.41 version and that is where we are stucked

Hi @Malick

Please make sure that when you upgrade from version to version to go through the upgrade notes:. When upgrading from version 2.39, you need to go through the instructions in dhis2-releases/releases/2.40/README.md at master · dhis2/dhis2-releases · GitHub and then if you’re upgrading to v41, you need to go through the upgrade notes: dhis2-releases/releases/2.41/README.md at master · dhis2/dhis2-releases · GitHub (and so on).

Thanks!