Is there a way to delete all IP addresses from database? Is there any plugin or any scripts to do that?
Please do not ask why you want to do that, it is jsut requirement and I want to get it done.
Is there a way to delete all IP addresses from database? Is there any plugin or any scripts to do that?
Please do not ask why you want to do that, it is jsut requirement and I want to get it done.
I went to Ask.discourse.com and got this, which seems probably true.
pfaffman:
Where are ip addresses stored. Can I delete them all from rails?
DiscourseHelper:
Searching for: Where are user and post IP addresses stored in the Discourse database, and is it possible to delete all stored IP addresses using Rails or through a rake task for privacy or GDPR compliance?
incoming_links,search_logs,topic_link_clicks,topic_views,user_profile_views,user_auth_tokens,user_auth_token_logs,screened_ip_addresses
Discourse stores IP addresses in several database tables, specifically:
You can delete IP addresses using Rails commands if you have terminal access (self-hosted installations). For each table, you can set the relevant column (like ip_address or client_ip) to NULL. Example for incoming_links:
IncomingLink.update_all(ip_address: nil)
You would run similar commands for each relevant table/column.
For more details and context about privacy and potential implications, see this discussion:
Problematic IP address fields
Note: If you’re on Discourse’s hosted service, you do not have SSH or Rails console access; in such cases, contact Discourse support at team@discourse.org for guidance.
Let me know if you need specific Rails commands for each table or further advice!
Interestingly it doesn’t look like it’s included the main ones, ip_address
and registration_ip_address
from the users table.
There are a couple of others too when I do a data explorer field search.
screened_emails.ip_address
screened_urls.ip_address
user_histories.ip_address
user_ip_address_histories.ip_address
Not all of them have any records in on my test site, but probably worth a check of your own tables to make sure they’re empty for you too.
Ha! It was the best I could do in my phone. It seemed like a lot so I thought it must have gotten it.