When starting a DB migration in a site already set for maintenance mode, the maintenance mode is switched off.
Do you mean the maintenance mode is switched off during the DB migration, or after the end of the migration?
I did observe the latter case with Moodle 1.6.1+ and think this should be fixed, as an admin having intentionaly put his site in maintenance mode before the migration should find it in the same state after it.
Nicolas, I founde the problem appearing after the migration to UTF-8 has been completed. However, maintenance mode switching may also happen during the migration, but I've not checked.
Should be fixed in both HEAD and STABLE now, thanks