3

what is the best way to bulk import users into userfrosting?

I tried importing CSV into uf_users table with flag_verified and flag_enabled set to 1, with requisite fields (id, user_name, display_name, password)

While data shows up in admin interface, individual users are not able to login.

Spurgeon
  • 148
  • 5
  • 12
  • Are you certain that the password hashes for the users you are importing, are compatible with one of the [password hashing methods](https://github.com/userfrosting/UserFrosting/blob/7d780a2c0cd6bbf65204ef7f0c1f5b0032e34744/userfrosting/models/database/User.php#L498-L527) that UserFrosting supports? – alexw Aug 28 '16 at 17:16
  • Thanks alex for helping with this. – Spurgeon Aug 29 '16 at 14:55
  • While this is may not be the best way to import, quest is on to find one ;-) – Spurgeon Aug 29 '16 at 14:55
  • 1
    Hey, nice that you solve your issue! In [so] we encourage you to [answer your own question](http://stackoverflow.com/help/self-answer) as a good way to share your knowledge. So, instead of updating your question, do add an answer with the details. Cheers! – fedorqui Aug 29 '16 at 14:56
  • Sure @fedorqui! thanks for the tip! – Spurgeon Aug 29 '16 at 15:02

1 Answers1

2

** Solution provided by Alex (@alexw) **

Thanks to the create of UF Alex (@alexw), further to the discussion at https://chat.userfrosting.com/channel/support, here is how import was solved - as suggested by Alex.

Add relevant rows to other related tables -

uf_user_event with fields event = 'sign_up', occured_at = timestamp, description = 'user xyz successfully registered on...'

uf_group_user with fields user_id = with id of imported user, group_id = 1 (that is default)

With this, the imported user is able to login!

Thanks Alex!

Spurgeon
  • 148
  • 5
  • 12