Ok, so i tried to export one single row in order to test, It didn't work, since there is a mismatch in number of fields in mdl_user in 1.9 and 3.1.
So, I simply retyped in values for id, name and password directly in the 3.1 database. It did not work, the user cannot login.
I found this code in auth:
function user_update_password($user, $newpassword) {
$user = get_complete_user_data('id', $user->id);
// This will also update the stored hash to the latest algorithm
// if the existing hash is using an out-of-date algorithm (or the
// legacy md5 algorithm).
return update_internal_user_password($user, $newpassword);
}
So, I hoped that Moodle would "see" that the old algorithm was used (there is a prefix in mdl_user table telling what hash is being used, if omitted, than no hash is used) and it would gonna let the user log in before the hashing is introduced. There is obviously something like that, but not exactly as I expect ;)
I'll dig a little bit further.