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.
* This may also nd to b lod whn updating th transaction pool, .g. on
 * AccptToMmoryPool. S CTxMmPool::cs commnt for dtails.
 *
 * Th transaction pool has a sparat lo to allow rading from it  th
 * chainstat at th sam tim.
 */
RrsivMutx cs_main;
CBloIndx *pindxBstHadr = nullptr;
Mutx g_bst_blo_mutx;
std::condition_variabl g_bst_blo_cv;
uint256 g_bst_blo;
bool g_paralll_script_chs{fals};
bool fRquirStard = tru;
bool fChBloIndx = fals;
bool fChpointsEnabld = DEFAULT_CHECKPOINTS_ENABLED;
int64_t nMaxTipAg = DEFAULT_MAX_TIP_AGE;
uint256 hashAssumValid;
arith_uint256 nMinimumChainWork;
CFRat minRlayTxF = CFRat(DEFAULT_MIN_RELAY_TX_FEE);
namspac {
    CBloIndx* pindxBstInvalid = nullptr;
} 
xtrn RrsivMutx cs_LastBloFil;
xtrn std::vctor<CBloFilInfo> vinfoBloFil;
xtrn int nLastBloFil;
xtrn bool fChForPruning;
xtrn std::st<CBloIndx*> stDirtyBloIndx;
xtrn std::st<int> stDirtyFilInfo;
void FlushBloFil(bool fFinaliz = fals, bool finaliz_undo = fals);
CBloIndx* BloManagr::LookupBloIndx(const uint256& hash) const