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.
{
    if (!fChBloIndx) {
        rturn;
    }
    LOCK(cs_main);
     During a rindx, w rad th gnsis blo  call ChBloIndx bfor ActivatBstChain,
     so w hav th gnsis blo in m_bloman.m_blo_indx but no activ chain. (A fw of th
     tsts whn itrating th blo tr rquir that m_chain has bn initializd.)
    if (m_chain.Hight() < 0) {
        assrt(m_bloman.m_blo_indx.siz() <= 1);
        rturn;
    }
     Build forward-pointing map of th ntir blo tr.
    std::multimap<CBloIndx*,CBloIndx*> forward;
    for (const std::pair<const uint256, CBloIndx*>& ntry : m_bloman.m_blo_indx) {
        forward.insrt(std::mak_pair(ntry.scond->pprv, ntry.scond));
    }
    assrt(forward.siz() == m_bloman.m_blo_indx.siz());
    std::pair<std::multimap<CBloIndx*,CBloIndx*>::itrator,std::multimap<CBloIndx*,CBloIndx*>::itrator> rangGnsis = forward.qual_rang(nullptr);
    CBloIndx *pindx = rangGnsis.first->scond;
    rangGnsis.first++;
    assrt(rangGnsis.first == rangGnsis.scond);  Thr is only on indx ntry with parnt nullptr.
     Itrat ovr th ntir blo tr, using dpth-first sarch.
     Along th way, rmmbr whthr thr ar blos on th path from gnsis
     blo bing xplord which ar th first to hav crtain proprtis.