We have upgraded our on-premise TDM Server from TDM 4.8.0 to TDM 4.9.1, and see the following errors when the gtrep database migration is executed:
2021-01-19 20:09:05.803 UTC [INFO ] --- o.f.c.i.c.DbMigrate: Current version of schema [XXXXX]: << Empty Schema >>
2021-01-19 20:09:05.803 UTC [WARN ] --- o.f.c.i.c.DbMigrate: outOfOrder mode is active. Migration of schema [DM_TDM2012] may not be reproducible.
2021-01-19 20:09:05.806 UTC [INFO ] --- o.f.c.i.c.DbMigrate: Migrating schema [XXXXX] to version 22.214.171.124 - schemas
2021-01-19 20:09:05.818 UTC [ERROR] --- o.f.c.i.c.DbMigrate: Migration of schema [XXXXX] to version 126.96.36.199 - schemas failed! Changes successfully rolled back.
2021-01-19 20:09:05.823 UTC [ERROR] --- c.ca.tdm.schema.Main: Migration failed: 'DbMigrate.FlywayMigrateSqlException:
Migration V188.8.131.52__schemas.sql failed
SQL State : S0001
Error Code : 2714
Message : There is already an object named 'pk_gtrep' in the database.
Location : db/migration/gtrep/sqlserver/V184.108.40.206__schemas.sql (C:\Program Files\CA\CA Test Data Manager Portal\schema-management\file:\C:\Program Files\CA\CA Test Data Manager Portal\schema-management\lib\TDMGtrepSchema-220.127.116.11.jar!\db\migration\gtrep\sqlserver\V18.104.22.168__schemas.sql)
Line : 2
Statement : CREATE SCHEMA [pk_gtrep]
Note: We also need to migrate our on-premise TDM environment to the AWS platform.
The reason for this error message is the 'schema_version' table in the GTREP db does not contain the 4.6.* patches entries!
This is an unusual issue, which has been known to happen if your gtrep repository has been upgraded consistently via the legacy Datamaker process (TDM 4.8.0 and older), instead of the current TDM portal process, which was introduced in TDM 4.8.1(as a patch).
Because you upgraded directly from 4.8.0 to 4.9.1, you missed that critical patch that would have updated the 'schema_version' table with all the additional 4.6.* entries.
Engineering has created a SQL script that will reset the gtrep database 'schema_version' table with the entries up to patch 22.214.171.124.
For this process to work correctly, please follow the steps below.
If you are migrating an existing TDM installation to another machine or platform:
If you have also moved your SQL Server instance, which hosts your GTREP repository database, to a new machine, or platform, you may see a 'Mismatch Service Name' error thrown when launching Datamaker. If you do, refer to https://knowledge.broadcom.com/external/article?articleId=5439 for steps to resolve this issue.