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

Hi!
When I created my forum, I didn’t think about the server being full, I thought it was automatically cleaned, I also didn’t know about copyright issues, problems with justice among other things, and even less did I go after information to not allow users of my forum to upload images to the server!

It turns out that now I’m going through several problems, full server, problems with the fairness of exposing images of others without rights, problems with copyright

I would like to know, how do I delete everything, all topics, all posted images, all images of members’ avatars, all files etc and only leave the discourse files (to run the forum) and the users

it is possible? What can I delete and what can’t I?
which command do i use?

when I type the command: df -h this appears

what’s in dev/vda1? I saw that it has 38g used, but 38g of what?

overlay is 38g too, what’s in that folder?

what can i delete and how do i delete? can you use commands through the prompt?

1 Like

Hello and welcome @xebiyen :slight_smile:

I’m afraid this isn’t my speciality, but I wondered if exporting/migrating your users into a fresh install may be another way to approach it?

2 Likes

You have 20gb free. Removing user posts will likely free up a few hundred mb. It won’t make a difference. You can likely free up a few gb with a

 ./launcher cleanup

If you have copyright issues you should just deal with those directly. You’ll just have them again.

/dev/vda is your whole drive. You can do

 du -hs /var/discourse/shared/standalone/*

To see how much space discourse is using.

4 Likes

It’s not a folder, that’s the overlayFS storage driver. The numbers are the same as /dev/vda1.

It’s safe to ignore.

1 Like

How is it done? In this case, would the site be new and would users continue?

I know it will remove little but I need it! I want to reset everything on my forum, and that won’t happen again, because I’ll set it up so that no one posts anything in the media.

How do you think your users would feel losing badges for posts, likes, etc? Eliminating all your content is both risky technically, and raises the possibility you’re going to alienate your users.

Just how big is the site now in terms of users, categories, and posts?

If you’re dead-set on this then consider hiding the current categories by changing permissions to staff only, and creating new public categories for posting.

5 Likes

this wouldn’t be a problem, because my users don’t care about it, and I have a small number of users

I was interested in this way of creating a new installation and keeping my users, do you know how to do that?

What’s preventing you from just restricting access to the current posts, rather than trying to edit the database?

If it’s a small site why not just bulk select and delete topics from the UI?

1 Like

In addition to what I told you, this forum belonged to another owner, so, for me, it would be better to do a reinstallation from scratch, but keeping the users, how do you do it?

I’m afraid my migration skills are non-existent, so even though I suggested it I unfortunately don’t know how to do it. :slight_smile: I was hoping someone else would jump in to at least confirm it’s possible. Anyone?

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

oh yes, when they talked about it, I thought it was exact and easier, so I’ll have to go back to my first option: deleting things on the server! Do you know what command I use to delete things on the server? And what folders can I delete? I want to delete everything, from media to topics, I just keep the same users, I don’t even want to keep the style of the forum, I really want to reset it.

What’s inside these two?

I was thinking of using the ‘Export’ button on the /admin/users/list/active page to get the user list. Maybe dropping some uneeded columns from the csv, and then importing that ‘somehow’.

1 Like

I don’t have much experience in discourse for that. I’m going to delete things on the server, what command do I use to delete the folder (if any) of all Discourse media? Including profile pictures, wall pictures, topics, chat messages, regular messages etc?

I don’t think there is any way to do that more easily than exporting your users and reinstall Discourse from scratch, and then importing your users “somehow” :smile:

What data do you want to keep from your users, and how many users so you have? The more precise you are, the most likely you’ll get accurate replies to try to solve your issue.

I’m using google translator, I don’t know if it translated correctly, but from what I understood, they wouldn’t return to the forum, but would they be invited? I wanted to keep them the same, no invitations. I didn’t understand the translation exactly, does it matter in what way?

my forum has 550 users

but they were imported to the point of being able to use the same users and passwords, or would they be invited to make a new registration?