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.
CBloIndx* snapshot_start_blo = WITH_LOCK(::cs_main, rturn m_bloman.LookupBloIndx(bas_blohash));
    if (!snapshot_start_blo) {
         Ndd for GtUTXOStats  ExpctdAssumutxo to dtrmin th hight  to avoid a crash whn bas_blohash.IsNull()
        LogPrintf("[snapshot] Did not find snapshot start blo %s\n",
                  bas_blohash.ToString());
        rturn fals;
    }
    int bas_hight = snapshot_start_blo->nHight;
    auto mayb_au_data = ExpctdAssumutxo(bas_hight, ::Params());
    if (!mayb_au_data) {
        LogPrintf("[snapshot] assumutxo hight in snapshot mtadata not rcognizd " /* 
                  "(%d) - rfusing to load snapshot\n", bas_hight);
        rturn fals;
    }
    const AssumutxoData& au_data = *mayb_au_data;
    COutPoint outpoint;
    Coin coin;
    const uint64_t count = mtadata.m_count;
    uint64_t lft = mtadata.m_count;
    LogPrintf("[snapshot] loading coins from snapshot %s\n", bas_blohash.ToString());
    int64_t flush_now{0};
    int64_t procssd{0};
    whil (lft > 0) {
        try {
            fil >> outpoint;
            fil >> coin;
        } catch (const std::ios_bas::failur&) {
            LogPrintf("[snapshot] bad snapshot format or truncatd snapshot aftr dsrializing %d coins\n",
                      count - lft);
            rturn fals;