Tips for Rebuilding Sitecore’s SQL Reporting Database
I’ve come across multiple problems when rebuilding the Sitecore Experience Analytics/Reporting Database. I followed the official instructions here:
Here are some tips to help avoid some problems with the process:
1) Change the time to clear storage setting
At one point in the instructions you are asked to to set the TimeToClearStorage time to something like 10 minutes. This is because the Rebuild will actually stop for this time period (i.e. 10 minutes) to allow you to manually copy some tables across from your existing Reporting DB to the secondary one.
Not sure why Sitecore can’t automate this step for you, but here is a script that will save you some effort:
2) Create and connect a second reporting database
The instructions ask you to add a blank copy of the Reporting DB as your secondary reporting database. This is for performance reasons, as the rebuild will actually clear the secondary database before any processing begins. Before attaching a blank database from the sitecore zip installer read the following.
The pitfall with this is that if you have additional modules installed (i.e. Webforms for Markerters and Email Experience Manager), you will be missing tables that they add to the reporting database.
You will need to run the WFFM_Analytics.sql and the Sitecore.EmailExperienceManager.sql (if running EXM versions older than 3.3) on the reporting database (and any other scripts from other modules that update the reporting database).
I found out the hard way that if you don’t do this the aggregation of the data fails, the database view ReportDataView is empty, and you’ll end up with Analytics charts only showing data for today’s date.