[3.8] Fix migration detection