Importing exported users csv



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.

(Jay Pfaffman) #2

This should do it:

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


Thanks Jay, will try this