How do I Import users in the database without re-hashing the password I want to import users from one database to another, without changing password.

Suppose the password is saved as $S$DfAoLR.OJWl04tkzgnZeE3TdJHlz6NxBNpArOKhQAewyyHDFDD in the database; I want to save the same value in the database of the other site.

Can anyone suggest me how to achieve this?
Do this :

&lt;?php
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
$old_hash = md5('password');
$hash_count_log2 = 11;

$new_hash = user_hash_password($old_hash, $hash_count_log2);

if ($new_hash) {
  // Indicate an updated password.
  $new_hash  = 'U' . $new_hash;
}
?&gt;


or you may check LINK1 or LINK2

Or you can directly import the data from one table to another :

INSERT INTO NewTable (ID, Name, Password)
  SELECT ID, Name, md5(Password) AS Password
  FROM OldTable
  WHERE ID BETWEEN 100 to 300


Check LINK once.