Answers.Body: <p><code>civicrm_activity</code> is a legitimate table with legitimate data.  You can use the API to mass-delete activities - but only you (and/or your users) can determine what represents data that is reasonable to delete.</p>
  
  <p>If it's that large, I suspect it's quite likely that you're sending frequent mailings to large groups of people - the mailing history might be reasonable thing to delete.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-16T19:08:55.497Z
Answers.Text: Do you know if deleting old mailings will remove the activities too? We've got a bad case of this with a few clients. For one, civicrm_activities is 3G. (Also would be nice to have a gui to batch delete/archive mailings but that's for a different convo).
Answers.UserDisplayName: herb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-16T22:21:08.530Z
Answers.Text: @herb Doing `SHOW CREATE TABLE civicrm_mailing` doesn't reveal any foreign keys - so it would have to happen at the PHP level if it happens.  And frankly, I doubt it; I know deleting a Contribution Batch doesn't delete the associated activity (with disastrous results).  I think someone wrote an archiver though - if you grab me on Mattermost I can tell you who to talk to.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-18T06:12:00.243Z
Answers.LastActivityDate: 2017-10-18T06:12:00.243Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I've got a civicrm database of 1.4 Go (information available in PhpMyAdmin)
  1Go is used by civicrm_activity table
  I would like to know if have to clean, purge the database to reduce its size, cache or others maintenance actions.</p>
  
  <p>I find some actions on documentation for cache files but nothing about database</p>
  
  <p>Thanks for advices</p>
  
Tags: <activities><database><cache>
Title: How cleanup civicrm database
ThreadText: # How cleanup civicrm database
  
  (Asked by: username_0 on 2017-10-17)
  
  I've got a civicrm database of 1.4 Go (information available in PhpMyAdmin)
  1Go is used by civicrm\_activity table
  I would like to know if have to clean, purge the database to reduce its size, cache or others maintenance actions.
  
  I find some actions on documentation for cache files but nothing about database
  
  Thanks for advices
  
  **Tags:** activities, database, cache
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-18. Score: 2
  
  `civicrm_activity` is a legitimate table with legitimate data. You can use the API to mass-delete activities - but only you (and/or your users) can determine what represents data that is reasonable to delete.
  
  If it's that large, I suspect it's quite likely that you're sending frequent mailings to large groups of people - the mailing history might be reasonable thing to delete.
  
  > **Comments:**
  > **username_2**: Do you know if deleting old mailings will remove the activities too? We've got a bad case of this with a few clients. For one, civicrm_activities is 3G. (Also would be nice to have a gui to batch delete/archive mailings but that's for a different convo).  
  > **username_1**: @username_2 Doing `SHOW CREATE TABLE civicrm_mailing` doesn't reveal any foreign keys - so it would have to happen at the PHP level if it happens.  And frankly, I doubt it; I know deleting a Contribution Batch doesn't delete the associated activity (with disastrous results).  I think someone wrote an archiver though - if you grab me on Mattermost I can tell you who to talk to.  
  
  ---
  
  