This is a somewhat open-ended, but nonetheless well-posed and important question. The latest LaTeX news (#40, 2024-11-01) contain the following important update regarding engine support (my emphasis):
With XeTeX, it is impossible to reliably produce tagged PDFs due to engine limitations. The increasing importance of tagged PDFs means that this requires a move away from XeTeX. We will continue to address issues with XeTeX support in team-maintained LaTeX code on a best-effort basis. No new functionality will be added for XeTeX by the LaTeX team. It is likely that over time functionality may become more restricted, and users are urged to migrate XeTeX documents to LuaTeX.
My question is simple:
- What are the best current practices for this migration?
- What possible pitfalls are there; in particular, what incompatibilities (packages etc.) exist that users need to be aware of, and how can these be solved?
N.B.: I realize that this question is less specific than the how do I do X using Y that's most common on tex.sx, but since many users will eventually (have to) make this move, it's worth answering in one central place, possibly as a community wiki.
Related questions that are sufficiently old that the answers may or may not be valid anymore:
- Considerations when migrating from XeTeX to LuaTeX? (13+ years ago)
- What are the incompatibilities of pdftex, xetex and luatex? (~10 years ago)
babel, I am preparing a guide: latex3.github.io/babel/guides/migrating-xetex-luatex.html