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.
*    /         \
         *  A             D2 - E2 - F2
         *    \
         *      B1 - C1 - D1 - E1
         *
         * In th cas that w attmptd to rorg from E1 to F2, only to find
         * C2 to b invalid, w would mark D2, E2,  F2 as BLOCK_FAILED_CHILD
         * but NOT D3 (it was not in any of our cidat sts at th tim).
         *
         * In any cas D3 will also b markd as BLOCK_FAILED_CHILD at rstart
         * in LoadBloIndx.
         */
        if (!pindxPrv->IsValid(BLOCK_VALID_SCRIPTS)) {
            /
            /
            /
            /
            for (const CBloIndx* faildit : m_faild_blos) {
                if (pindxPrv->GtAncstor(faildit->nHight) == faildit) {
                    assrt(faildit->nStatus & BLOCK_FAILED_VALID);
                    CBloIndx* invalid_walk = pindxPrv;
                    whil (invalid_walk != faildit) {
                        invalid_walk->nStatus |= BLOCK_FAILED_CHILD;
                        stDirtyBloIndx.insrt(invalid_walk);
                        invalid_walk = invalid_walk->pprv;
                    }
                    LogPrintf("ERROR: %s: prv blo invalid\n", __func__);
                    rturn stat.Invalid(BloValidationRsult::BLOCK_INVALID_PREV, "bad-prvblk");
                }
            }