Friday, July 27, 2018

Mongo DB for Sitecore

This is the head of your page. Example HTML page

MongoDB 

MongoDB is an open-source document database, and leading NoSQL database. MongoDB is written in c++. MongoDB is a highly scalable and performance oriented database. 

Database 

Database is a physical container for collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases. 

Collection 
Collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a single database. Collections do not enforce a schema. Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purpose. 

Document 
A document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data. 
Below given table shows the relationship of RDBMS terminology with MongoDB 

RDBMS 
MongoDB 
Database 
Database 
Table 
Collection 
Tuple/Row 
Document 
Column 
Field 
Table Join 
Embedded Documents 
Primary Key 
Primary Key (Default key _id provided by mongodb itself) 


Advantages of MongoDB over RDBMS 
·      Schema less: MongoDB is document database in which one collection holds different documents. Number of fields, content and size of the document can be differing from one document to another. 
·      No complex joins 
·      Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL 
·      Tuning 
·      Ease of scale-out: MongoDB is easy to scale 
·      Conversion / mapping of application objects to database objects not needed 
·      Uses internal memory for storing the (windowed) working set, enabling faster access of data 
Why should use MongoDB 
·        Document Oriented Storage : Data is stored in the form of JSON style documents 
·      Index on any attribute 
·      Replication & High Availability 
·      Auto-Sharding 
·      Rich Queries 
·      Fast In-Place Updates 
·      Professional Support By MongoDB 
Where should use MongoDB? 
·      Big Data 
·      Content Management and Delivery 
·      Mobile and Social Infrastructure 
·      User Data Management 
·      Data Hub 

Installing MongoDB for sitecore

1.   Go to http://www.mongodb.org/downloads and download the 64 bit .zip file. Unzip the files in a directory on your computer.

2.   Setup Connection string in your project
<?xml version="1.0" encoding="utf-8"?>
<connectionStrings>
  <!--
    Sitecore connection strings.
    All database connections for Sitecore are configured here.
  -->
  ...
  ...
  ...
  <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" />
  ...
</connectionStrings>
Sitecore 7.5 (and Sitecore 8.x) connectionstrings.config are already set up correctly.
3.   run 'mongod.exe', check “C:\Program Files\MongoDB\Server\3.2\bin”
  1. Create a data folder:
    1. C:\data\db
  2. In admin command prompt, navigate to the MongoDB bin folder
    1. c
    2. cd C:\Program Files\MongoDB\Server\3.2\bin
  3. Run the following command
    1. mongod --dbpath="C:\data\db"
    2. --logpath="C:\data\db\log.txt" --install
  4. Start –> run –> type in services.msc
  5. Look for “MongoDB”, click start

Thursday, July 26, 2018

Installing Coveo for Sitecore


Installation Procedure
2.     Upload and install the last Coveo for Sitecore official package corresponding to your Sitecore version from Downloads using the Sitecore Installation Wizard ( Sitecore Desktop > Start Menu > Development Tools > Installation Wizard).
This operation can take several minutes to complete. If you are asked whether to overwrite files or items during the installation, click Yes to all.
3.     Once the package is installed, the Coveo for Sitecore Configuration Wizard will appear.
4.     From the Welcome screen, you can access useful documentation about the installation process. When you are ready to proceed, click Next.

5.     In the Connect to Coveo Cloud screen:


a.     Click Sign-Up or Log Into Coveo Cloud.
b.     In the Log into Coveo Cloud page, choose your authentication provider and enter your credentials.
c.     In the Grant Privileges page, click Authorize.
6.     In the Coveo Cloud Organization screen:
a.     If you do not have access to a Coveo organization, you will be given the opportunity to create one.
If you have bought a Coveo for Sitecore Pro or Enterprise edition subscription, you should already have access to an organization with those rights, and should follow step 6.b instead.
                 i.          In New organization name, enter the name of your new organization.
                ii.          In Select your license plan, select On-Premises Free Edition.
              iii.          Click Next.

b.     If you already have access to a Coveo Cloud organization, you should be able to select an existing organization:
                 i.          Select your organization.
                ii.          Click Next.

c.     If you already have access to a Coveo organization, but would like to create a new organization:
                 i.          In the drop-down, select Create new organization.
                ii.          In New organization name, enter the name of your new organization.
              iii.          In Select your license plan, select On-Premises Free Edition.
              iv.          Click Next.

7.     In the Configure where the Coveo index is located screen:
a.     Choose either one of these options:
                 i.          If you will be running CES and Sitecore locally, on the same server, choose On the same server as this Sitecore instance.

                ii.          If you will be running CES remotely, on a separate server, choose On a remote server.

b.     In Coveo Index Path, enter the path of the index folder on the CES server (typically C:\CES7).
·        If you have not already performed the First-Time Setup in CES, specify a path of your choice (e.g. D:\CES7). The required index folder will be created where you specified on the CES server, and the Coveo.SearchProvider.config.example file will be updated to reflect this location. If you have already performed the First-Time Setup, specify the path of the index folder created by CES (the default location is C:\CES7).
·        Make sure that you enter a path with a valid format. You should not use a network or DFS path.
8.     In the Configure the REST endpoint screen:
In Search API URI, enter:
a.     For a local setup: http://localhost:8080/
b.     For a remote setup: http://{CES server's FQDN or alias}:8080/
The port is 8080 by default but can be changed. See Changing the REST Search API Default Port.
9.     In Application Secret, enter the application secret of the Coveo Search API (located in the applications/secret node of the config.yml file).
The Application Secret is not the same thing as the Secret Token created during CES setup. Entering an incorrect application secret will result in a 403 - Permission Denied error.
10. Click Next.

11. In the Configure the RabbitMQ indexing queue connection screen:
a.     In URI, enter:
                  .          For a local setup: amqp://localhost:5682/
                 i.          For a remote setup: amqp://{CES server's FQDN or alias}:5682/
b.     In Username, enter the username of a RabbitMQ administrator account (the default value is guest).
c.     In Password, enter the password of the account (the default value is guest).
If you set up your own RabbitMQ administrator credentials while installing CES (see Installing Coveo Enterprise Search (CES) On-Premises), you must specify those credentials here.
The password entered on this screen is encrypted and saved in the Coveo.SearchProvider.Custom.config.example file. Coveo for Sitecore (December 2016)  
An encryption key is automatically created in the core database of your Sitecore instance.

12. Click Next.
13. In the Configure the Coveo Admin Service screen:
In Admin Service URI, enter:
·        For a local setup: http://localhost/AdminService, OR
·        For a remote setup (unsecured): http://{CES server's FQDN or alias}/AdminService, OR
·        For a remote setup (secured): https://{CES server's FQDN or alias}/AdminService

14. In case you want to secure the Admin Service:
 .       Select Use a secure Admin Service.
a.     In Admin Service Username, enter the username that you configured in CES to secure the Admin Service.
b.     In Admin Service Password, enter the password that you configured in CES to secure the Admin Service.
The admin service password entered on this screen is encrypted and saved in the Coveo.SearchProvider.Custom.config.example file. Coveo for Sitecore (December 2016)  
An encryption key is automatically created in the core database of your Sitecore instance.
c.     In Certificate File, choose the certificate file ( .pfx) that was previously generated and exported by the CES installation wizard.
d.     In Private Key Password, enter the certificate’s private key password that you configured previously in the CES installation wizard.
e.     In Administrator Username, enter the username of an account that is a member of the Local Administrators group on the Sitecore server.
f.       In Administrator Password, enter the password of the account.

15. Click Next.
16. In the Configure the Sitecore credentials used to retrieve security permissions screen:
 .       In Username, enter the username of the Sitecore account to use to retrieve security permissions of indexed items.
a.     In Password, enter the password of the Sitecore account to use to retrieve security permissions of indexed items.
The password entered on this screen is encrypted and saved in the Coveo.SearchProvider.Custom.config.example file. Coveo for Sitecore (December 2016) 
An encryption key is automatically created in the core database of your Sitecore instance.
17. Click Next.

18. In the Configure Body indexing options screen, s elect the type of body indexing that you prefer for your Sitecore items.
 .       To index only Sitecore item data, select Only index Sitecore item data.

a.     To index the full HTML rendering of the published Sitecore items, choose Index rendered HTML.

b.     In the Configure Body indexing options screen:
c.     If you do not need to index permissions, select Disable Security Permissions on Documents, and click Next .

19. To activate Coveo for Sitecore, in the Activate Coveo for Sitecore screen:
 .       Check Automatically rename the files.
a.     Click Next.

b.     Click Close, and after a few moments you should see the the last screen of the Configuration Wizard. This screen contains links to useful documentation to finalize your Coveo for Sitecore installation.

20. Depending on your Sitecore revision, there may be some lines that you want to uncomment in the Coveo.SearchProvider.config file. Scan the file for any relevant section. For example, you may want to uncomment the fields/field[@fieldName="culture"] node if you are using a Sitecore revision later than 150400.
If you installed CES on a remote server, you need to perform additional steps (see  Setting Up Coveo for Sitecore in a Remote Server Configuration - On-Premises ).
21. Click Close in the Configuration Wizard.
22. Once the Configuration Wizard is closed, make sure that you restart both the Sitecore client and server.
When the Search API is installed on a different machine from CES, you should configure the Search API service manually (for the available options, see Windows Service Configuration File).

23. On the server where the Search API service is running, open the config.yml file (typically located under C:\Program Files\Coveo Search API 8).
When editing the config.yml file, make sure that you indent settings using spaces only. Tabs are considered invalid and will therefore prevent the configuration from loading properly.
After having saved your config.yml file, you must restart your Coveo Search API service for your modifications to take effect.
 .       Ensure that the serverCertificatePath setting points to a valid certificate path. The path should be <CES index path>\Config\Certificates\cert-ca.pem.
a.     Ensure that the clientCertificatePath setting points to a valid certificate path. The path should be <CES index path\Config\Certificates\cert-iis.p12.
24. Start the Coveo Search API service.
You can access the services list from Control Panel > System and Security > Administrative Tools > Services.
If you are using the web database, publish the master database, as items created by Coveo for Sitecore will need to be replicated to this database as well.