Rebuilding Sitecore 8 Analytics Indexes

Hello Readers ,

As I continue to explore my learnings with Sitecore 8, The topic for todays post is about “how to rebuild sitecore analytics indexes”.

Quickly you might ask me, why can’t we just use the Indexing Manager to rebuild Analytics Indexes, Well If you take a look at the below image you can clearly see that the analytics index is missing from the list and it is on purpose because if you take a look at the Sitecore.ContentSearch.Lucene.Index.Analytics.config file inside your include folder the index is specified as part of the group experience and hence it is excluded.


What data is stored in Analytics Index

The indexes contains data from the collection(MongoDB) and reporting(a.k.a Analytics) databases which is used in applications such as Engagement Analytics reports and the Executive Insight Dashboard. This data contains mostly information about tracking data about visitors such as online visits,contacts (visitors),personalization,goals, campaigns, profiles,pattern cards and multivariate tests.

Why do we need to rebuild Analytics Index

One of the primary reasons is that if the data in the indexes is out of sync or corrupted, However there are some other benefits too such as :

  • Reporting Application in sitecore such as Executive Dashboard / Engagement Analytics shows stale or No data
  • Experience Optimization dashboard shows incorrect multivariate test data
  • if data in the collection database (Mongodb) has changed and has become out of sync. For example,classification of contact or locations.

Finally, Step by Step Instructions on Rebuilding Analytics Databases

  • Attach a clean analytics database to your SQL Server and name it Analytics_secondary
  • Open your connectionstrings.config file and add a reference to you secondary analytics database

    [code language=”xml”]
    <add name="reporting" connectionString="user id=sa;password=12345;Data Source=.\SQLServer;Database=Analytics" />
    <add name="reporting.secondary" connectionString="user id=sa;password=12345;Data Source=.\SQLServer;Database=Analytics_Secondary" />

  • The Sitecore Analytics Index Rebuilding is triggered when you aggregate visitors data. So to trigger index rebuild, you need to trigger reporting db rebuilding. Navigate to this page http://{your_site}/sitecore/admin/RebuildReportingDB.aspx
  • click on Start and the rebuild should get started
  • Once the rebuild completes , you should see the below messageAfterRebuild
  • Finally Open your connectionstrings.config file, Rename your reporting.secondary name to reporting, since your newly rebuilt secondary database is your reporting database and comment out the original reporting connections string

    [code language=”xml”]
    <!–<add name="reporting" connectionString="user id=sa;password=12345;Data Source=.\SQLServer;Database=Analytics" /> –>
    <add name="reporting" connectionString="user id=sa;password=12345;Data Source=.\SQLServer;Database=Analytics_Secondary" />

Good Reads

3 thoughts on “Rebuilding Sitecore 8 Analytics Indexes

Add yours

  1. Sheetal, great article. I ran into an error when performing these steps but also found the solution. The error was: “Exceeded the cut off date before copying definitions”

    This question was found on stackoverflow which included the resolution:

    1. Make sure you attach a clean reporting database (this was already complete in my case)
    2. Make sure that the SQL user account has the db_owner role for both reporting databases (the Sitecore documentation doesn’t mention this –
    3. Delete contents of \Data\indexes\sitecore_analytics_index

  2. I’m curious. The steps here suggest that we should start the reindex and then wait till it completes. The sitecore article has a step where it suggests were are supposed to copy over a selection of marketing tables from primary to secondary after starting it:
    “In the Rebuild Reporting Database page, when you see Waiting to receive to data status, copy the following marketing definition tables from the primary to the secondary reporting database:
    “… a bunch of tables …”
    “After you have added these tables the Rebuild Reporting Database page resumes the rebuilding process.”

    I did run it, and it did finish after about 12 minutes without me copying over any tables manually. What’s your take on this step in the sitecore docs?

Leave a Reply

Powered by

Up ↑

%d bloggers like this: