Importing exported users csv

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.

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)
exit
exit
6 Likes

Thanks Jay, will try this

1 Like