Fix migration detection
Merge pull request #412 from romainneutron/migration-detection

[3.8] Fix migration detection