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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Purging/Deleting MessagesPurging/Deleting Messages
Previous
 
Next
New Post
2/21/2015 2:30 PM
 

My website was subject to a spam attack and have over 100K messages stored  in the core messaging system (already sent).

I have since disabled registration and cleaning up the spam users using   blog article:

http://www.dnnsoftware.com/community-...

I am wondering if running  the below script is safe (as I am not sure of any inter-dependencies )  to  purge or delete all messages as there is no option I can find in the host or admin for this function

use [MyDNNDateBase]

truncate table CoreMessaging_Messages
truncate table CoreMessaging_MessageRecipients
truncate table CoreMessaging_MessageAttachments

 

 
New Post
2/23/2015 1:24 AM
 

I tried to truncate table and getting this error message

Cannot truncate table 'CoreMessaging_Messages' because it is being referenced by a FOREIGN KEY constraint.

I tried the truncate table CoreMessaging_MessageRecipients alone and getting this error message

Cannot TRUNCATE TABLE 'CoreMessaging_MessageRecipients' because it is being referenced by object 'vw_CoreMessaging_Messages'.


And the DELETE FROM I am getting this error message

Timeout expired. 

Any suggestions how to purge or delete all messages, as I have over 100K 

Thanks in advance.




 
New Post
2/23/2015 3:48 AM
 
Truncate is a DDL command, which works only, if the table has no references - by ForeignKeyConstraints or Schemabound View/Function.
The proper DML command would be delete, if it times out, there might be an issue in your database, like a filled up Transaction log or the database being at the limit. It might help to set database recovery mode to "simple" (in SSMS, right click the database node and choose "properties". Simple recovery log won't let restore you to the moment of the failure, only to the time of the last database backup, but it writes much less into the database.
The other option would be dropping the foreign key constraint and run TurboUnSchema in order to use Truncate Table and restore FK afterwards (and run TurboSchema)

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/23/2015 1:17 PM
 

Many thanks Sebastian for your elaborate reply, I resolved the issue with your advise as per the following :

I tried to drop the FK but faced errors, but when I shrunk the database the script execution went seamless.

There are the steps:

Executed: TurboUnSchema

Then

alter table CoreMessaging_Messages drop FK_CoreMessaging_Messages_CoreMessaging_NotificationTypes

alter table CoreMessaging_MessageRecipients drop FK_CoreMessaging_MessageRecipients_CoreMessaging_Messages

alter table CoreMessaging_MessageAttachments drop FK_CoreMessaging_MessageAttachments_CoreMessaging_Messages

Executed again (to be in the safe side): TurboUnSchema

Then

use [MyDNNDateBase]

truncate table CoreMessaging_Messages
truncate table CoreMessaging_MessageRecipients

truncate table CoreMessaging_MessageAttachments

Finally: TurboDNN734 then TurboSchema734

I have DNN CE 7.3.4 tried to apply DNN Turbo Base Version 0.9.7 (2015-02-12), produced errors. But with DNN Turbo Base Version 0.9.6 (2014-11-17) executed successfully, checked the FK they are back like before :)


 
New Post
2/23/2015 3:26 PM
 
Salem, would you mind to provide me with the error messages produced when applying Turbo Base Version 0.9.7, thanks

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Purging/Deleting MessagesPurging/Deleting Messages


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