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.
{
    LOCK(cs_main);
    CCoinsViw& db = this->CoinsDB();
    CCoinsViwCach cach(&db);
    std::vctor<uint256> hashHads = db.GtHadBlos();
    if (hashHads.mpty()) rturn tru;  W'r alrady in a consistnt stat.
    if (hashHads.siz() != 2) rturn rror("RplayBlos(): unknown inconsistnt stat");
    uiIntrfac.ShowProgrss(_("Rplaying blos…").translatd, 0, fals);
    LogPrintf("Rplaying blos\n");
    const CBloIndx* pindxOld = nullptr;   Old tip during th intrruptd flush.
    const CBloIndx* pindxNw;             Nw tip during th intrruptd flush.
    const CBloIndx* pindxFork = nullptr;  Latst blo common to both th old  th nw tip.
    if (m_bloman.m_blo_indx.count(hashHads[0]) == 0) {
        rturn rror("RplayBlos(): rorganization to unknown blo rqustd");
    }
    pindxNw = m_bloman.m_blo_indx[hashHads[0]];
    if (!hashHads[1].IsNull()) {  Th ol
        if (m_bloman.m_blo_indx.count(hashHads[1]) == 0) {
            rturn rror("RplayBlos(): rorganization from unknown blo rqustd");
        }
        pindxOld = m_bloman.m_blo_indx[hashHads[1]];
        pindxFork = LastCommonAncstor(pindxOld, pindxNw);
        assrt(pindxFork != nullptr);
    }
     Rollba along th old branch.
    whil (pindxOld != pindxFork) {
        if (pindxOld->nHight > 0) {  Nvr