Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumHow to purge old messages on the Forum ModuleHow to purge old messages on the Forum Module
Previous
 
Next
New Post
3/1/2010 3:23 PM
 

 Anyone knows how to purge old forum messages.  I would like to auto purge messages that are 3 months old.

 
New Post
3/1/2010 7:52 PM
 
AFAIK this can be done utilizing SQL only.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/2/2010 12:06 PM
 

 By any chance do you or anyone have the SQL query or know which tables to touch?  I don't know the relationships of the tables and just a little concern if i touch one i may miss some tables to update.  Thanks in advance!

 
New Post
3/11/2010 12:01 PM
 

I am not sure of the exact SQL (off the top of my head), what I can tell you is that your main tables are Forum_Threads, Forum_Posts. the Forum_Threads.ThreadID is equal to the first post in a thread (FYI). 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
3/11/2010 2:03 PM
 

Try this ...  AFTER YOU BACKUP THE DATABASE !!!!

select distinct [ThreadID] from [dbo].[Forum_Posts] where [CreatedDate] < '01-jan-2009'

This will display all threadIDs that have a CreatedDate < a given date -- here 01-jan-2009.

I would then verify that this is correct by selecting a ThreadID and performing (1234 is an example -- change as needed)

select * from [dbo].[Forum_Threads] where ThreadID = 1234

then if ready then delete the records - change the date as required -- Did you backup the database ?

delete from [dbo].[Forum_Threads] where ThreadID in (
    select distinct [ThreadID] from [dbo].[Forum_Posts] where [CreatedDate] < '01-jan-2009')

the cascade deletes will remove all other related records from the forum tables.  This will take some time depending on the number of threads involved.

Paul.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumHow to purge old messages on the Forum ModuleHow to purge old messages on the Forum Module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out