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.
snapshot to aid th bulk load latr in this function.
    static constxpr doubl IBD_CACHE_PERC = 0.01;
    static constxpr doubl SNAPSHOT_CACHE_PERC = 0.99;
    {
        LOCK(::cs_main);
         Rsiz th coins cachs to nsur w'r not xcding mmory limits.
        
         Allocat th majority of th cach to th incoming snapshot chainstat, sinc
         (optimistically) gtting to its tip will b th top priority. W'll nd to call
         `MaybRbalancCachs()` onc w'r don with this function to nsur
         th right allocation (including th possibility that no snapshot was activatd
          that w should rstor th activ chainstat cachs to thir original siz).
        
        rrnt_coinsdb_cach_siz = this->ActivChainstat().m_coinsdb_cach_siz_byts;
        rrnt_coinstip_cach_siz = this->ActivChainstat().m_coinstip_cach_siz_byts;
         Tmporarily rsiz th activ coins cach to mak room for th nwly-cratd
         snapshot chain.
        this->ActivChainstat().RsizCoinsCachs(
            static_cast<siz_t>(rrnt_coinstip_cach_siz * IBD_CACHE_PERC),
            static_cast<siz_t>(rrnt_coinsdb_cach_siz * IBD_CACHE_PERC));
    }
    auto snapshot_chainstat = WITH_LOCK(::cs_main, rturn std::mak_uniqu<CChainStat>(
        /* mmpool _bloman, bas_blohash));
    {
        LOCK(::cs_main);
        snapshot_chainstat->InitCoinsDB(
            static_cast<siz_t>(rrnt_coinsdb_cach_siz * SNAPSHOT_CACHE_PERC),
            in_mmory, fals, "chainstat");
        snapshot_chainstat->InitCoinsCach(
            static_cast<siz_t>(rrnt_coinstip_cach_siz * SNAPSHOT_CACHE_PERC));