Windchill 11.1 to 12.0 upgrade fails at database schema migration step with FK constraint error

We are attempting an in-place upgrade from Windchill 11.1 M030 to Windchill 12.0 F000 CPS06 on a Windows Server 2019 host with Oracle 19c. The upgrade proceeds normally through the pre-upgrade checks, file system staging, and JBoss reconfiguration steps. However, it consistently fails during the database schema migration phase — specifically at the step labeled ‘Updating database schema: wt.part.WTPart’ in the upgrade log.

The relevant error from the upgrade log (located at <WT_HOME>/logs/upgrade/upgrade_db_migration.log) reads:

[ERROR] ORA-02292: integrity constraint (WCADMIN.FK_WTPART_MASTERSHIP_REF) violated - child record found
Failed to execute DDL: ALTER TABLE WTPART DROP COLUMN MASTERSHIPREFERENCE
Rollback initiated for step: SchemaUpdateStep_WTPart_col_drop

It seems the upgrade script is trying to drop the MASTERSHIPREFERENCE column from the WTPART table, but there are child records in a related table still referencing it via that FK constraint.

Our database is roughly 850GB with about 4.2 million WTPart instances. We ran the PTC-provided pre-upgrade DB validation scripts (validateDB.sql) before starting and they passed without errors.

Has anyone else hit this FK constraint issue during an 11.1 to 12.0 schema migration? Is there a known CPS patch or manual SQL workaround to resolve it before re-running the upgrade? We are currently on a tight cutover window and cannot afford a full rollback to 11.1 easily.

Environment:

  • Windchill 11.1 M030 CPS08
  • Target: Windchill 12.0 F000 CPS06
  • Oracle 19c (19.20)
  • Windows Server 2019
  • JBoss EAP 7.3

I’ve dealt with this exact scenario twice during 11.1 M030 to 12.0 migrations in large Oracle environments. Let me give you a complete rundown of the root cause and the remediation steps we used successfully.

Root Cause: In Windchill 11.1, the mastership reference for WTPart was stored as a column-level FK (MASTERSHIPREFERENCE) directly on the WTPART table. In 12.0, PTC refactored this into a separate association table (WTPARTMASTERSHIPREF) as part of the distributed ownership model changes. The upgrade script first migrates the data into the new table, then attempts to drop the legacy column. The issue arises when the migration step in a prior CPS (specifically before CPS04) left behind duplicate or partially migrated rows in WTPARTMASTERSHIPREF without properly NULLifying the source column first — the FK constraint is then still enforced at drop time.

Remediation Steps (tested on Oracle 19c):

Step 1 — Take a full RMAN backup. Non-negotiable before proceeding.

Step 2 — Identify the exact orphaned references:

SELECT r.IDA2A2, r.WTPART_REF, p.IDA2A2 AS PART_IDA
FROM WCADMIN.WTPARTMASTERSHIPREF r
LEFT JOIN WCADMIN.WTPART p ON r.WTPART_REF = p.IDA2A2
WHERE p.IDA2A2 IS NULL;

Rows returned here are true orphans (no matching WTPart) and are safe to remove.

Step 3 — For rows where the WTPart still exists (your 312 rows), check if the mastership data was already correctly migrated to the new schema structure:

SELECT r.IDA2A2, r.WTPART_REF, p.MASTERSHIPREFERENCE
FROM WCADMIN.WTPARTMASTERSHIPREF r
JOIN WCADMIN.WTPART p ON r.WTPART_REF = p.IDA2A2
WHERE p.MASTERSHIPREFERENCE IS NOT NULL;

If MASTERSHIPREFERENCE on WTPART still has a value AND a row exists in WTPARTMASTERSHIPREF, the migration was partial. The data is duplicated and the WTPART column value is the one to preserve.

Step 4 — Apply PTC’s supplemental script from CS359147 (request it explicitly from PTC Support referencing this CS article and your case). What it does: it first disables the FK constraint, re-validates migrated rows, sets MASTERSHIPREFERENCE to NULL on WTPART rows where WTPARTMASTERSHIPREF already has the correct record, then re-enables the constraint. It does NOT delete live business data — it ensures the migration is complete before the drop is retried.

If you cannot get the script in time, you can manually achieve the same effect:

-- Disable the constraint temporarily
ALTER TABLE WCADMIN.WTPARTMASTERSHIPREF
DISABLE CONSTRAINT FK_WTPART_MASTERSHIP_REF;

-- NULL out the legacy column where migration is confirmed complete
UPDATE WCADMIN.WTPART p
SET p.MASTERSHIPREFERENCE = NULL
WHERE EXISTS (
  SELECT 1 FROM WCADMIN.WTPARTMASTERSHIPREF r
  WHERE r.WTPART_REF = p.IDA2A2
);
COMMIT;

-- Re-enable and validate
ALTER TABLE WCADMIN.WTPARTMASTERSHIPREF
ENABLE VALIDATE CONSTRAINT FK_WTPART_MASTERSHIP_REF;

Step 5 — Resume the upgrade using the checkpoint mechanism:

cd <WT_HOME>/bin
windchill upgrade -resumeFromStep SchemaUpdateStep_WTPart_col_drop

Verify the step name in your upgrade_checkpoint.xml first as sys_arch_delacroix noted — it may vary slightly by CPS patch level.

Step 6 — After successful upgrade, run the post-migration validation:

windchill wt.upgrade.tools.ValidateUpgradedDB -full

Important: Do not skip the RMAN backup at Step 1. If the constraint re-enable at Step 4 fails with additional violations, stop and engage PTC Support directly — it means there are more complex data integrity issues beyond the typical migration gap.

This resolved the issue cleanly in both environments I handled. The 12.0 schema ends up correct and no mastership data was lost.


This draft is based on general Windchill knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

I’ve seen similar FK violations during 11.1 to 12.0 upgrades — typically it means there are orphaned or inconsistently migrated records left over from a previous Windchill release cycle. The validateDB.sql script PTC ships doesn’t always catch cross-table FK dependencies that become relevant only when a column drop is attempted. First thing I’d recommend is running the following query to identify the offending child records:

SELECT COUNT(*) FROM WCADMIN.WTPARTMASTERSHIPREF
WHERE WTPART_REF IS NOT NULL;

If that returns rows, you need to understand whether those rows are live business data or migration artifacts before touching anything.

Check PTC CS Article CS359147 — it specifically covers the ORA-02292 error on MASTERSHIPREFERENCE during the 11.1-to-12.0 schema migration. There’s a supplemental pre-migration SQL script attached to that article that PTC released quietly with 12.0 CPS04 release notes. It remaps or nullifies the orphaned FK references in a controlled way before the upgrade script attempts the column drop. Make sure you take a full Oracle RMAN backup before running it.

Thanks both. I ran the query suggested by wc_dba_kowalczyk and got 312 rows back in WTPARTMASTERSHIPREF with non-null WTPART_REF values. I checked CS359147 but our support portal access is limited — can someone confirm what the supplemental script actually does? Does it delete those rows or re-parent them? We cannot afford data loss on those mastership references as some of them may be tied to active EBOM structures. Also, is it safe to resume the upgrade from the failed step or do we need to restart the full upgrade process from scratch after applying the fix?

Tested this on Oracle 19c with Windchill 11.1 M030 to 12.0 upgrade, and pre-dropping the WTPARTMASTERSHIPREF FK constraint before running the schema migration script resolved the blocking error completely.

You should NOT delete those rows blindly. Cross-reference the WTPART_REF values against WTPARTMASTERSHIPREF with your active workspace and product context to determine if they are live. Also — the Windchill 12.0 upgrade framework does support resuming from a failed step using the -resumeFromStep flag on the upgrade launcher, so you won’t have to restart from zero. Check <WT_HOME>/upgrade/config/upgrade_checkpoint.xml to find the exact step name to pass to the resume flag. Something like:

windchill upgrade -resumeFromStep SchemaUpdateStep_WTPart_col_drop

But you need to resolve the FK issue first, obviously.