I have a Drupal 7 site with a bunch of users. I want to migrate the users to Drupal 8 but not any of the content so I'm writing a crosswalk. Drupal 8 has uuid in the users table. Is there a way I can compute this or can I just set it to NULL? Thanks!
No, cannot be empty.
You can generate one with
$uuid_service = \Drupal::service('uuid'); $uuid = $uuid_service->generate();
If you use User::create it will automatically generate one for you.
Drupal\user\Entity\User::create([ 'uid' => $uid, 'name' => '$user_name, 'mail' => $email, 'roles' => , 'pass' => [ 'value' => $hashed_drupal_7_password, 'pre_hashed' => TRUE, ], 'status' => 1, ])->save();
Rather than code it from scratch. The proper, Drupal way, to migrate is using all of these:
I suggest your read this article A Quick Guide to Migrating Drupal Content from D7 to D8 which goes over how to migrate users and other scenarios.