# Import users from csv

**URL:** https://meta.discourse.org/t/import-users-from-csv/79203
**Category:** Development
**Created:** [January 28, 2018, 1:18pm UTC](https://meta.discourse.org/t/import-users-from-csv/79203 "2018-01-28T13:18:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![michaeltcoelho](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeltcoelho/32/120344_2.png) [@michaeltcoelho](https://meta.discourse.org/u/michaeltcoelho)
#### Post date: [January 28, 2018, 1:18pm UTC](https://meta.discourse.org/t/import-users-from-csv/79203/1 "2018-01-28T13:18:13Z")

</div>

Hi there,

i’ve exported users from my blog into a csv. Trying to import on discourse through a rake script i’m getting the following error:

```plaintext
NoMethodError: undefined method `bio_raw_will_change!' for nil:NilClass
/var/www/discourse/lib/promotion.rb:57:in `change_trust_level!'
/var/www/discourse/app/models/user.rb:757:in `change_trust_level!'
/var/www/discourse/app/services/trust_level_granter.rb:13:in `grant'
/var/www/discourse/app/services/trust_level_granter.rb:8:in `grant'
/var/www/discourse/app/models/group_user.rb:73:in `grant_trust_level'

```

Here is the script:

> <https://gist.github.com/michaeltcoelho/6616f3b707692fb4eedaa75d85c299d3>

Anyone could help me on this?

it would be very nice if i could a reset password email to each user. if i do it am i going to get rate limited?

\*\* Sorry but i’m not a ruby dev…

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 29, 2018, 7:19pm UTC](https://meta.discourse.org/t/import-users-from-csv/79203/2 "2018-01-29T19:19:20Z")

</div>

What is the content of the CSV? Are you importing more than just emails and groups? [Sending bulk user invites](https://meta.discourse.org/t/sending-bulk-user-invites/16468) might work if you’re simply trying to get users onto the site and into certain groups.

---

<div class="post-metadata">

### Author: ![michaeltcoelho](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeltcoelho/32/120344_2.png) [@michaeltcoelho](https://meta.discourse.org/u/michaeltcoelho)
#### Post date: [January 29, 2018, 7:31pm UTC](https://meta.discourse.org/t/import-users-from-csv/79203/3 "2018-01-29T19:31:32Z")

</div>

Hey @jomaxro, these are the columns:

```plaintext
email;name;username;tile;groups

```

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [January 29, 2018, 7:35pm UTC](https://meta.discourse.org/t/import-users-from-csv/79203/4 "2018-01-29T19:35:24Z")

</div>

Yeah, that’s more than the bulk invite tool will work with. You’ll need to get your rake task working, or use the API. Unfortunately I can’t assist with that.

---

<div class="post-metadata">

### Author: ![michaeltcoelho](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeltcoelho/32/120344_2.png) [@michaeltcoelho](https://meta.discourse.org/u/michaeltcoelho)
#### Post date: [January 29, 2018, 7:38pm UTC](https://meta.discourse.org/t/import-users-from-csv/79203/5 "2018-01-29T19:38:02Z")

</div>

I tried by API but, it gets rate limited. I got this script on [GitHub - vindia/discourse\_user\_importer: A tiny script to import users from a CSV file into Discourse · GitHub](https://github.com/vindia/discourse_user_importer), but it’s not working as i’ve described on this thread.
