How do I migrate users passwords from Drupal 6 to Drupal 7?
To update the md5 password to the hashed one I needed to use user_hash_password() and concact an 'U'. Here is the script that I used to make it work.

&lt;?php
        require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
        $res = db_query('select * from drupal.users');

        if($res) {
                foreach ($res as $result) {
                        $hashed_pass = user_hash_password($result-&gt;pass, 11);
                        if ($hashed_pass) {
                          $hashed_pass  = 'U' . $hashed_pass;
                          db_update('users')-&gt;fields(array('pass' =&gt; $hashed_pass))-&gt;condition('uid', $result-&gt;uid)-&gt;execute();
                        }
                }
        }


Then I ran 

drush scr &lt;name_of_the_script_file&gt;


And it worked.