That’s the fastest and easiest way, from far.
Download your user list as @JammyDodger suggested, from /admin/users/list/active, download the CSV file, clean it up to keep only the email addresses, and do a bulk invite from your admin interface from a new Discourse installation. Your users will have to create an account again.
If you want to delete all data except some users, there is no easy way to do that and I can only think that trying could easily lead to a broken forum.
If you want to export most data of your users (their own settings and stuff), it will also be difficult and will require creating a ruby on rails script. Also, you could face issues that I didn’t think about. If you’re not sure how to do that, I’d suggest you stick to the first solution or post in marketplace if you have a budget.
That’s true. But if you want to live dangerously, you can try this:
./launcher enter app
discourse backup
rails c
Topic.where("user_id > 1").destroy_all
Upload.where("user_id > 1").destroy_all
exit
exit
I think that deleting topics should delete posts, but you could also add a
Post.where("user_id > 0").destroy_all
The > 1 will leave topics created by the first user. If you want to delete those as well, change it to > 0,which will leave topics created by @system. I think you’ll be very sorry if you delete those.
That makes a backup in case it destroys everything.
This is almost certainly a bad idea, but it’s what you asked for.
Thank you for confirming this. I wanted to be sure, because one or two of the recommended methods for other things listed on Administrative Bulk Operations had unwanted side effects the last time I used them.
I used one to move topics from one category to another but it moved the about topic along the regular topics. I might have used a rails script instead of the rake task though. I’m not sure.
You can try by yourself, but do a backup first.
Go to your discourse folder in command line.
Enter the container with ./launcher enter app.
Then write rake destroy:topics_all_categories.