Thursday, 29 October 2015

Setting up Mongo DB for developer use with Sitecore

Here are some simple steps to set up Mongo for use with Sitecore.  I used these for a development Sitecore 8 installation:

  1. Download and install mongodb from https://www.mongodb.org/downloads?_ga=1.194443182.2054203937.1446139202#production
  2. Create a bat file to initialize the mongo db, something like:

    "C:\Program Files\MongoDB\Server\3.0\bin\mongod.exe" -dbpath "C:\inetpub\wwwroot\[Sitecore Project]\Databases\Mongo"

    N.B. I always have the database created in the Sitecore website's databases folder.
  3. Double click the bat file - you can use software like Always Up (http://www.coretechnologies.com/products/AlwaysUp/) to turn the bat file into a pseudo windows service, which means you don't have to kick it off every time you start windows.
  4. The analytics part of your connections strings config should look something:
    <add name="analytics" connectionString="mongodb://localhost/analytics"/>
    <add name="tracking.live" connectionString="mongodb://localhost/tracking_live"/>
    <add name="tracking.history" connectionString="mongodb://localhost/tracking_history"/>
    <add name="tracking.contact" connectionString="mongodb://localhost/tracking_contact"/>
  5. Login to Sitecore and you should now see the graph (which defaults to Interactions by visits and value per visits) appear at the bottom of the screen:

    Sitecore 8

No comments:

Post a comment