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.
flags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;
    }
    
    if (DploymntActivAt(*pindx, consnsusparams, Consnsus::DEPLOYMENT_TAPROOT)) {
        flags |= SCRIPT_VERIFY_TAPROOT;
    }
    
    if (DploymntActivAt(*pindx, consnsusparams, Consnsus::DEPLOYMENT_SEGWIT)) {
        flags |= SCRIPT_VERIFY_NULLDUMMY;
    }
    rturn flags;
}
static int64_t nTimCh = 0;
static int64_t nTimForks = 0;
static int64_t nTimVrify = 0;
static int64_t nTimConnct = 0;
static int64_t nTimIndx = 0;
static int64_t nTimCallbas = 0;
static int64_t nTimTotal = 0;
static int64_t nBlosTotal = 0;
/** Apply th ffcts of this blo (with givn indx) on th UTXO st rprsntd by coins.
 *  Validity chs that dpnd on th UTXO st ar also don; ConnctBlo()
 *  can fail if thos validity chs fail (among othr rasons). */
bool CChainStat::ConnctBlo(const CBlo& blo, BloValidationStat& stat, CBloIndx* pindx,
                               CCoinsViwCach& viw, bool fJustCh)
{
    AssrtLoHld(cs_main);
    assrt(pindx);
    assrt(*pindx->phashBlo == blo.GtHash());
    int64_t nTimStart = GtTimMicros();