Capital™ Migrating to 2207.2308 or above. Database schema failed initial checks, migration stopped

2023-11-09T16:06:00.000-0500
Capital Capital Component Manager Capital Project Manager Capital Access Manager

Summary

The problem only arises when migrating from an older version to Capital 2207 with 2308 Updates or above. UPDATE2308.sql has been shipped, as part of Update 2308 release, which adds indexes to the database schema. These additional indexes improve the performance of the ‘Where Used’ search functionality in Project. The new indexes cause the database schema mismatch errors. The error is met during the background integrity checks that Capital Data Migrate (CDM) executes at the beginning of the upgrade process. The Update2308.sql needs to be run before CDM is executed.


Details

To identify the problem, check the following three migration log files located in the working repository path setup in CDM.
1. Error in Capital Data Migrate log file states:
INFO: Running premigration checks at.. Wed, Aug 30, 11:57 AM 
INFO: Running script.. C:\Apps\Capital\data\sql\embedded\upgradeto2207\post_upgrade_check_capital.sql
INFO: Collecting missing database objects into the file C:\MigrationRepository\logs\DatabaseSchemaMismatchErrors2207.log INFO: Premigration checks ended at Wed, Aug 30, 11:57 AM
chs.capitalmigrate.CapitalDataMigrateException: Database schema failed initial checks, migration stopped|The database schema does not match requirements for migration.

2. The post_upgrade_check_capital2207.log file states:

Tables found: 954 Indexes found: 2680 Columns found: 7222 Constraints found: 5612 Triggers found: 19 Functions found: 15. This does not match the expected values (954/2691/7222/5612/19/15).

3. The DatabaseSchemaMismatchErrors2207.log file lists the 11 missing indexes:

Running script.. C:\MentorGraphics\Capital_2207\data\sql\embedded\upgradeto2207\check_missing_indexes_capital.sql
ERROR: Index not found with the name sbomsubassembly_objectid
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name operationaditnalcmp_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name projectprefredpart_library_id
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name projectsharedcond_library_id
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name projectusagedef_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name sharedbackshell_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name shareddeviceconn_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name sharedmulticore_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name sharedtermination_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name specializedconn_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE
ERROR: Index not found with the name terminalblckconn_libraryref
  Where: PL/pgSQL function inline_code_block line 6 at RAISE

Note: This is only a problem for migrating to a new 2207 database. The indexes have been added to the 2308 main release schema upgrade scripts, therefore the problem is not present when upgrading to the Capital main release 2308 nor 2308.2310 and above.


If your log files have different messages, please open a support case to investigate. If they match the messages above proceed with the following migration flow:

1. Install base release

  • For Embedded/PostgreSQL/ it will create the new 2207 Database
  • For Oracle follow directions to create new 2207 database (unless performing in-situ upgrade)

2. Install latest Updates (2308 or above). In these releases you will find the UPDATE2308.sql file in this location:

  • For Embedded/PostgreSQL environment at <Capital install folder>data/sql/embedded/upgradeto211
  • For Oracle environment at <Capital install folder>data/sql/oracle/upgradeto211

3. The DBA should log into the new 2207 database as the Capital user and run UPDATE2308.sql.  

4. Start Capital Data Migrate from 2207 installation and complete upgrade steps


If a manual upgrade has been performed, in other words without running CapitalDataMigrate.exe, the DBA can just run the UPDATE2308.sql script to add the indexes to the 2207.XXXX database. The sql does not modify any data.
 

 

KB Article ID# KB000122824_EN_US

Contents

SummaryDetails

Associated Components

Capital