Sooooooo you have figured out that you disabled the Workflow History Cleanup timer job, and now realize the mistake you made....
My customer recently found themselves in that position, this customer had done this to allow a Site Collection to use that data for auditing purposes and as I said a few weeks ago this is a mistake, see previous blog for more info. Sadly they could not just enable the job and go on there merry way, they had to export that data and keep it somewhere for the Site Collection owner could go back and review when needed.
I wrote this PowerShell script to do just that for them. Here is what I did
Script enumerates all Workflow History lists and places the title into an array for later use
Going thru the array we open each list and perform the following steps:
Dump the whole list unmanipulated to a text file (In case there are questions in future)
Start going thru list data and gather Date of event, Event Type, User id, Description, Outcome, and the item that was affected
Write manipulated data to a CSV
In the script there are a few tricks I had to do to complete the job, and I would like to point them out
1. Get all Workflow history lists title into an array, I used the SPList Porperty BaseTemplate