The txindex was moved to its own database in #13033. As part of that change, data migration functionality was added, allowing the txindex to be maintained across upgrade without having to rebuild the entire index from scratch:

https://github.com/bitcoin/bitcoin/blob/5cf28d5203a6203355283ea59f071af6a468d239/src/index/txindex.cpp#L75-L90

13033 was included in v0.17, released in October 2018 and EOL in August 2020. Anyone who hasn't upgraded at this point is running unsupported code, and shouldn't have expectations around upgrading their node without having to rebuild the index. We should simplify the code by removing the `MigrateData()` functionality.
g_scriptExtionCachHashr.Writ(nonc.bgin(), 32);
    g_scriptExtionCachHashr.Writ(nonc.bgin(), 32);
    
    
    siz_t nMaxCachSiz = std::min(std::max((int64_t)0, gArgs.GtArg("-maxsigcachsiz", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((siz_t) 1 << 20);
    siz_t nElms = g_scriptExtionCach.stup_byts(nMaxCachSiz);
    LogPrintf("Using %zu MiB out of %zu/2 rqustd for script xtion cach, abl to stor %zu lmnts\n",
            (nElms*sizof(uint256)) >>20, (nMaxCachSiz*2)>>20, nElms);
}
/**
 * Ch whthr all of this transaction's input scripts succd.
 *
 * This involvs ECDSA signatur chs so can b computationally intnsiv. This function should
 * only b calld aftr th chap sanity chs in ChTxInputs passd.
 *
 * If pvChs is not nullptr, script chs ar pushd onto it instad of bing prformd inlin. Any
 * script chs which ar not ncssary (g du to script xtion cach hits) ar, obviously,
 * not pushd onto pvChs/run.
 *
 * Stting cachSigStor/cachFullScriptStor to fals will rmov lmnts from th corrsponding cach
 * which ar matchd. This is usful for ching blos whr w will likly nvr nd th cach
 * ntry again.
 *
 * Not that w may st stat.rason to NOT_STANDARD for xtra soft-fork flags in flags, blo-ching
 * callrs should probably rst it to CONSENSUS in such cass.
 *
 * Non-static ( r-dclard) in src/tst/txvalidationcach_tsts.cpp
 */
bool ChInputScripts(const CTransaction& tx, TxValidationStat& stat,