XF 2.2 How I Purged old Conversations in database

ActorMike

Well-known member
I simply picked a conversation ID that was in the timeframe I wanted and executed this query. In this case the id was 17783.

DELETE FROM databasename.xf_conversation_message WHERE (conversation_id <= '17783');
DELETE FROM databasename.xf_conversation_master WHERE (conversation_id <= '17783');
DELETE FROM databasename.xf_conversation_recipient WHERE (conversation_id <= '17783');
DELETE FROM databasename.xf_conversation_user WHERE (conversation_id <= '17783');

FYI-
Database size before 265,667 KB
Database size after 242,352 KB
 
I'd be wary about purging old conversations. I did it once, picked a date in the past, bearing in mind our forum has been running for 22 years, and received a deluge of complaints from some long-standing members who'd collected numerous messages over time as quick references, info, etc, and suddenly found them all vanished.
Luckily I had a backup of the tables so managed to reinstate them.

If you are going to do it give plenty of notice to your members first
 
I'd be wary about purging old conversations. I did it once, picked a date in the past, bearing in mind our forum has been running for 22 years, and received a deluge of complaints from some long-standing members who'd collected numerous messages over time as quick references, info, etc, and suddenly found them all vanished.
Luckily I had a backup of the tables so managed to reinstate them.

If you are going to do it give plenty of notice to your members first
Our forum has been running since 2001. Not one person said a peep after I purged them. Probably depends on what kind of forum you run, but our goal is to provide public information that is indexed on Google, not long-term private storage for people to do things behind the scenes and take up resources.
 
It would also be cool if we had a way to delete old attachments, which may take even bigger space though. Nonetheless I agree with ActorMike, reducing the database size would benefit all users by making everything run faster as well, so why not? Unless they think our forums are a mailing service. On a side note, they could still access their mails indeed, if any, as when you have a conversation with someone, by default you also receive an email with the text of the conversation, which would help them retrieve the contents eventually. Not my case as well, though. Nobody complained.
 

Some other ways to bulk delete.
 
Back
Top Bottom