3

I have a CiviCRM site with 30,000 contacts. I am noticing a number of places where history is logged. The database is getting larger over time. Does anybody have any thoughts on removing history. Has anybody created scripts to cleanup old history data.

  • What do you mean by history ? Activities ? 30000 contacts doesn't seems like a big number, do you have performance problem or is it more about finding relevant information ? – samuelsov Oct 27 '14 at 21:57
  • I am old school. Don't like to keep a lot of history online. I remember when a gig of disk took 30 feet X 5 feet X 3 feet. My age is showing. – Bruce Sicherman Oct 27 '14 at 23:41

2 Answers2

11

I am not sure what history you want to delete but here are couple of things you can do. All the logging and history data are important, so think twice before deleting them.

1) If you have "Logging" Enabled under Misc., you will get a log table for every table in CiviCRM database.

2) Every contact has Changelog, I assume by history you mean this one.

3) Remove deleted records permanently, this will eliminate the possibility to check revision records in some places.

4) Extremely, you can even delete activities but you will not want to do that.

At the end of the day, it is a CRM, deleting any of the records is a loss of data.

Guanhuan
  • 398
  • 1
  • 8
4

If you are referring to the detailed logging option (as set up as by @popcm) then you can set this detailed logging to write to a separate database - it's a setting in the civicrm.settings.phop file.

Then you could occasionally dump all the data from this database and store it offline, emptying online the database on each occasion.

If you are referring simply to the changelog history or other aspects of the CiviCRM data, then as @popcm indicates, you really don't want to delete this as you'll only regret it later.

If keeping lots of data online is a concern, look to strengthen your security.

Graham
  • 201
  • 1
  • 3