Restoring Historical Reporting Data

    HELP! My reporting data and graphs have gone missing! How will I ever get that information back? You may encounter this problem after migrating your application to a new server or making changes to your jiveHome directory. When this happens, you may see data missing from the graphs on the Reporting tab in the admin console. These graphs are modified each night when the system processes the day's events, but you may have lost all of your data prior to the server migration.

     

    Never fear, our engineering team built in a utility just for that situation. It does require a little bit of effort, so read on...

     

    Here's the fix:

     

    0) Back up your database.

    1) Remove all data from jivestat for all dates except the most recent two days.

    i.e.

    SELECT DISTINCT to_timestamp(statdate/1000), statdate FROM jivestat ORDER BY statdate DESC;
    DELETE FROM jivestat WHERE statdate < <timestamp>;
    

    (the to_timestamp function is Postgres-specific)

     

    2) Set the system property stats.historical.enabled = true

    3) Restart the server. A background task will kick in within 10 minutes and begin to rebuild the jivestats table and graphs.

    4) Remove the stats.historical.enabled system property (very important to avoid creating duplicate data on next startup).

     

    That should do it!