migrate detect_host