How to delete EVERYTHING from my forum and just leave the users?

How many users do you have?
If you have to start again from scratch, an alternative would be to export your users’ email addresses (using data explorer for example) as a CSV file, re-create your forum, and bulk invite your users using the CSV file.


Another idea, more difficult, and I’m not sure it would work as I think it should.
Export all your users’ data you want to keep (since you don’t want to keep their avatar, maybe you want to skip other information as well) using data-explorer and export the result as a file.
Then, after installing your new forum, create a rails script that will parse the file and create user entries in the database (as well as their options, emails…). :person_shrugging:

Here’s an example of user creation in the rails console:

Another script I found here: https://meta.discourse.org/t/import-users-from-csv/79203:

The script doesn’t work at some point (hence the #support category :smile:), but it may contain interesting info nonetheless.

3 Likes