Create user accounts from a content type I have Drupal 7 website. Initial requirement was to accept membership from public (anonymous users) without creating a user account. So the plan was to create a content type called ‘membership’ that has the fields Name, email address, mobile number, a unique alphanumeric ID and other fields for personal/professional details.

Now the requirement is changed and need to create a user account for each of this ‘membership’ type of content.

Is there any way to create user accounts from each of existing content of the type ‘Membership’ by fetching email id from the ‘email field’ and password from the ‘unique alphanumeric ID’ field (or some other means)?
One solution is using VBO module, create a view with what content type you want ("membership") then perform a run a PHP code operation on them, and put something like this in Php code

$name = $entity-&gt;title; //fill it with what field you want
$email = $entity-&gt;YOUR_EMAIL_FIELD_MACHINE_NAME['und'][0]['value'];
$pass = $entity-&gt;YOUR_PASS_FIELD_MACHINE_NAME['und'][0]['value'];
$new_user = array(
  'name' =&gt; $name,
  'pass' =&gt; $pass, // note: do not use md5
  'mail' =&gt; $email,
  'status' =&gt; 1,
  'init' =&gt; $email,
  'roles' =&gt; array(
    DRUPAL_AUTHENTICATED_RID =&gt; 'authenticated user',
  ),
);

// The first parameter is sent blank so a new user is created.
user_save('', $new_user);


and another solution is create your custom Batch operation   and try some thing like up snippet.