Skip to main content

Disable xDB in Sitecore 7.5 with Sitecore Analytics Enabled for Basic Personalization

In our project, we use Sitecore 7.5 and we enabled Sitecore Analytics so that we can do basic personalization in the renderings. In Sitecore 7.5, we do not have CMS-Only mode like Sitecore 8.1. If we do not have xDB database setup, we have seen many repeated Mongo DB errors in the log files. Moreover these repeated logs slows down the authoring and production environment.

We contacted Sitecore to provide a patch to disable the xDB errors and it seems it is not possible in Sitecore 7.5 but to upgrade our Sitecore instance to 8.1.

As a workaround to disable these errors, we went ahead and disabled background services and other related configurations in Sitecore analytics. This has disabled the unncessary errors related to Mongo DB and analytics but Sitecore basic personalization was still working for our renderings. 

Warning: These configuration changes may affect other functionalities related to Sitecore Analytics.

Few Errors:

5588 03:00:31 ERROR MongoDbDictionary.Store() has failed.
Exception: Sitecore.Analytics.DataAccess.DatabaseNotAvailableException
Message: Database not available
Source: Sitecore.Analytics.MongoDB
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.Execute(Action action, ExceptionBehavior exceptionBehavior)
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.Save(Object value)
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDictionary.Store(Object value)


ManagedPoolThread #9 07:59:51 ERROR Unable to connect to server localhost:27017: No connection could be made because the target machine actively refused it 127.0.0.1:27017.



7060 03:00:20 ERROR Exception when executing agent aggregation/recovery
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
   at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Analytics.Core.BackgroundService.CreateAgent()
   at Sitecore.Analytics.Core.BackgroundService.ExecuteAgent()
   at Sitecore.Analytics.Core.BackgroundService.Run()

Nested Exception

Exception: System.InvalidOperationException
Message: Connection string settings not available (tracking.live)
Source: Sitecore.Analytics.MongoDB
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDriver.FromConnectionString(String connectionStringName)
   at Sitecore.Analytics.Data.MongoDb.ProcessingPool.MongoDbProcessingPool..ctor(String connectionStringName)



1.     In \Website\App_Config\Include\Sitecore.Analytics.config, modify the config values.
<setting name="Analytics.LogLevel" value="None" />
<setting name="Analytics.PerformLookup" value="false" />

2.     In \Website\App_Config\Include\Sitecore.Analytics.config, comment out these lines.

<!--<hooks>
      <hook type="Sitecore.Analytics.ConfigLoader, Sitecore.Analytics" />
      <hook type="Sitecore.Analytics.BackgroundServiceLoader, Sitecore.Analytics" />
 </hooks> -->

            <!--<sessionEnd>
<processor type="Sitecore.Analytics.Pipelines.SessionEnd.RaiseVisitEnd, Sitecore.Analytics"/>
            </sessionEnd>-->

            <!--<scheduling>
      <agent type="Sitecore.Analytics.Tasks.EmailReportsTask, Sitecore.Analytics" method="Run" interval="0:00:00">
        <DatabaseName>master</DatabaseName>
      </agent>
    </scheduling>-->

3.     Disable these configuration files completely.

\Website\App_Config\Include\
Sitecore.Analytics.Automation.TimeoutProcessing.config
Sitecore.Analytics.Reporting.RemoteClient.config
Sitecore.Analytics.Reporting.RemoteServer.config
Sitecore.Analytics.Tracking.RobotDetection.config

4.     In \Website\App_Config\Include\Sitecore.Analytics.Processing.Aggregation.ProcessingPools.config, comment out these lines.

<!--<pipelines>
      <initialize>
        <processor type="Sitecore.Analytics.Automation.Pipelines.Initialize.RegisterDataModelExtensions, Sitecore.Analytics.Automation.MongoDB" />
      </initialize>
    </pipelines>-->

In the same configuration, change enabled tag value of <processingPools> to false.

5.     In \Website\App_Config\Include\Sitecore.Analytics.Processing.Aggregation.Services.config, comment out these tags completely.
·         <automationAggregationSubsystem>
·         <hooks>

6.     In \Website\App_Config\Include\Sitecore.Analytics.Processing.Services.config, comment out these tags completely.

·         <hooks>

7.     In \Website\App_Config\Include\Sitecore.Analytics.Tracking.config, comment out these lines.

<!--<events>
      <event name="media:request">
        <handler type="Sitecore.Analytics.Media.MediaRequestEventHandler, Sitecore.Analytics" method="OnMediaRequest"/>
      </event>
    </events>-->


      <!--<httpRequestEnd>
        <processor type="Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics, Sitecore.Analytics" patch:before="processor[@type='Sitecore.Pipelines.PreprocessRequest.CheckIgnoreFlag, Sitecore.Kernel']"/>
      </httpRequestEnd>-->

      <!--<httpRequestProcessed>
        <processor type="Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics, Sitecore.Analytics"/>
      </httpRequestProcessed>-->
     
      <!--<initialize>
        <processor type="Sitecore.Analytics.Pipelines.Loader.InitializeAnalytics, Sitecore.Analytics" />
      </initialize>-->

      <!--<renderLayout>
        <processor type="Sitecore.Analytics.Pipelines.HttpRequest.StartAnalytics, Sitecore.Analytics" patch:before="processor[@type='Sitecore.Pipelines.RenderLayout.InsertRenderings, Sitecore.Kernel']" />
      </renderLayout>-->

      <!--<sessionEnd>
        <processor type="Sitecore.Analytics.Pipelines.SessionEnd.InitializeTracker, Sitecore.Analytics" patch:before="*" />
      </sessionEnd>-->

8.     In \Website\App_Config\Include\Sitecore.Analytics.Tracking.Database.config, comment out these lines.

      <!--<postSessionEnd>
        <processor type="Sitecore.Analytics.Pipelines.PostSessionEnd.CommitSession, Sitecore.Analytics" />
      </postSessionEnd>-->


    <submitQueue>
      <!--<backgroundService type="Sitecore.Analytics.SubmitQueueService, Sitecore.Analytics">-->
        <!-- Service wakeup interval in seconds. -->
        <!--<Interval>0</Interval>
      </backgroundService>-->

9.     Apart from these configuration changes, you can check each Sitecore analytics related configuration and set the timer to 00:00:00 for schedulers, background jobs etc.. 

Popular posts from this blog

How to use SecurityDisabler and UserSwitcher in Sitecore v6.5 – 6

If current context user doesn’t have permission to access this item, Sitecore will return null or throw exception. 
Note: It is recommended to provide context user with appropriate rights than using SecurityDisabler or UserSwitcher.SecurityDisabler:  !SecurityDisabler will elevate the context user to have administrative privilegeand so context user will be able to do anythingon the system.new Sitecore.SecurityModel.SecurityDisabler();UserSwitcher:UserSwitcher allows a segment of code to run under a specific user instead of current context user. new Sitecore.Security.Accounts.UserSwitcher(Sitecore.Security.Accounts.User.FromName("username",false));Sample Code        ///<summary>/// Code snippets explaining SecurityDisabler and UserSwitcher///</summary>privatevoid SecuritySample()        {//Getting Master Database            Sitecore.Data.Database masterDB = Sitecore.Configuration.Factory.GetDatabase("master");//Getting a Sitecore Item            Sitecore.…

How to access Sitecore Items in Code Behind (Sitecore v6.5) – 4

To get a Sitecore Content Item, use Sitecore.Data.Database.GetItem(Path)
­Sitecore Content Item Class: Sitecore.Data.Items.Item(Get Sitecore Item from “/sitecore/content/Home/myItem”)Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");Sitecore.Data.Items.Item myItem = master.GetItem("/sitecore/content/Home/myItem");If item does not exist or current context user doesn’t have permission to access this item, Sitecore will return null or throw exception. Case is Insensitive while using path to get the items.To get a Sitecore Template Item, use Sitecore.Data.Database.GetTemplate(ID)­Sitecore Template Item Class: Sitecore.Data.Items.TemplateItem(Get Template Item: Folder Template)Sitecore.Data.Items.TemplateItem item = master.GetTemplate(Sitecore.TemplateIDs.Folder);To get a Sitecore Media Item, use Sitecore.Data.Database.GetItem(Path)­Sitecore Media Item Class: Sitecore.Data.Items.MediaItem(Get Media Item from “/sitecore/content/Media Lib…

How to enable Single Sign On in Sitecore with Active Directory Users and Roles

(Assuming that reader has knowledge on Single Sign On)

Single sign on functionality needs the site not to be in anonymous authentication. In IIS, Basic or Windows authentication should be enabled.
How to enable windows authentication in IIS?
Single sign on functionality comes along with Active Directory Module from Sitecore. You can get the latest version from SDN. This module integrates AD to the Sitecore instance. This module needs the LDAP path and few provider configuration settings in web.config file.
SDN Link: http://sdn.sitecore.net/Products/AD/Download.aspx
This module installs LDAP dll, configuration and few aspx pages. Once installed, we get the LDAP login page under /website/Sitecore/admin/ldaplogin.aspx. Along with that, we will be having few more roles in Sitecore.
sitecore\Sitecore Client Account Managing sitecore\Sitecore Client Authoring sitecore\Sitecore Client Configuring sitecore\Sitecore Client Designing sitecore\Sitecore Client Developing sitecore\Sitecore Client Forms Autho…