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.

indexing

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
    <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
    BeforeRebuild
  • 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
    <!--<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

http://www.sitecore.net/Learn/Blogs/Technical-Blogs/Getting-to-Know-Sitecore/Posts/2014/10/Introducing-the-Sitecore-Analytics-Index.aspx
http://www.sitecore.net/Learn/Blogs/Technical-Blogs/Getting-to-Know-Sitecore/Posts/2014/11/Rebuilding-the-Sitecore-Analytics-Index.aspx

Advertisements

3 Responses to “Rebuilding Sitecore 8 Analytics Indexes”

  1. Nathan Miller Says:

    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:
    http://stackoverflow.com/questions/29155209/rebuilding-reporting-database-sitecore-8

    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 – https://doc.sitecore.net/sitecore%20experience%20platform/xdb%20configuration/walkthrough%20rebuilding%20the%20reporting%20database_
    3. Delete contents of \Data\indexes\sitecore_analytics_index

  2. Praful Memane Says:

    Where can I find the “executive insight dashboard” in sitecore 8.0

  3. raigunn Says:

    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:

    https://doc.sitecore.net/Sitecore%20Experience%20Platform/xDB%20configuration/Walkthrough%20Rebuilding%20the%20reporting%20database
    “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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: