# Importing exported users csv

**URL:** https://meta.discourse.org/t/importing-exported-users-csv/72643
**Category:** Support
**Created:** [October 23, 2017, 9:50pm UTC](https://meta.discourse.org/t/importing-exported-users-csv/72643 "2017-10-23T21:50:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![testingsoftware](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@testingsoftware](https://meta.discourse.org/u/testingsoftware)
#### Post date: [October 23, 2017, 9:50pm UTC](https://meta.discourse.org/t/importing-exported-users-csv/72643/1 "2017-10-23T21:50:26Z")

</div>

Hi,

I see there is an “Export” option that will give me a CVS file with all the users details. I want to change all users trust levels and lock them at level 2. I could do this in the CVS file but then, is there a way to import it again?

Thanks guys.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 23, 2017, 10:31pm UTC](https://meta.discourse.org/t/importing-exported-users-csv/72643/2 "2017-10-23T22:31:25Z")

</div>

This should do it:

```plaintext
cd /var/discourse
./launcher enter app
rails c
User.where("id > 0 and admin != true").update_all(trust_level: 2, trust_level_locked: true)
exit
exit

```

---

<div class="post-metadata">

### Author: ![testingsoftware](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@testingsoftware](https://meta.discourse.org/u/testingsoftware)
#### Post date: [October 23, 2017, 11:20pm UTC](https://meta.discourse.org/t/importing-exported-users-csv/72643/3 "2017-10-23T23:20:03Z")

</div>

Thanks Jay, will try this

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/importing-exported-users-csv/72643/4 "2024-06-08T12:44:12Z")

</div>

This topic was automatically closed after 2419 days. New replies are no longer allowed.
