Make sure the correct mode is chosen during upgrade

LMS-1127