The database of my SilverStripe website gets too big. When I have a look at the mysql tables it turns out SiteTree_versions and PageView are the culprits.
I could remove all content for PageViews, but I'd suggest a nice button in the admin interface saying: "clean up database from old visits ~ +3 months ago", for instance.
I could as well drop SiteTree_versions content manually but this might prevent me from reverting to the current revision with further editing, as pointed out here: http://www.silverstripe.org/archive/show/166007
Could you please give me the mysql code to get rid of all history versions BUT THE MOST RECENT, for every page of the current site tree? Would be awesome... but I just can't figure the mysql command... and besides: linking it to a button in admin interface would be so coool ;o)
I imagine you'd be best of learning how to do this using the object-relational layer SS provides rather than a direct MySQL queries. You'll get to understand better what SS is doing with all these version files, I reckon. Have a look at the "Versioned" class in saphire/core/model.