Thursday, April 10, 2014

How to connect a PIM solution to EPiServer Commerce 7.5


Product Information Management, in short called PIM, is important for driving consistency product information across digital channels. A PIM solution will make all product information available from a central point in a reliable, meaningful, and timely way to people, processes and applications that rely on it.

There have been written several blog post and information about PIM, but there are very few, if any, with in depth information on how you setup a PIM solution with EPiServer Commerce 7.5. The PIM solution I have used is inRiver 5.3, which have a really nice “out of the box” adapter to EPiServer Commerce.

You can find a nice introduction to PIM here: http://nordicecommerceknowledge.se/PIM--en-viktig-del-i-en-multikanalstrategi/ (only in Swedish)
 
The blog post became quite long, so I have split it up in two. First blog post will contain how to setup InRiver and how to connect the Rich Client Editor to it. I have tried to document some of the pitfalls you may run into.
 
The second blog post will be about inRiver Connect and how you should configure it to be able to publish products to EPiServer Commerce.
 

Architecture

My solution is based on the same infrastructure setup as you see in the figure below. You could of course set it up on one single server, but it’s not recommended in a production environment. It is important to notice that inRiver can’t be setup with several servers in a load balancing environment. This is normally not a problem, but it’s advisable to stack the inRiver server with enough CPU power and memory to handle scaling and cropping of pictures, if you have a lot of channels to support.
 

Let's continue with the details on how to setup the SQL, inRiver server and Rich Client editor.

Necessary requirements when installing of Microsoft SQL

Let’s start with database first. You can install either Microsoft SQL 2012 R2 Server or SQL 2008 R2 Server. Remember to enable Filestream when you install it, since inRiver require it. Both inRiver and EPiServer Commerce requires you to use a full version of SQL, so using Web Edition of SQL Server is not suitable for any part of this solution.
 
If you already got an MS SQL database available, then here is how you enable Filestream. Go to “Sql Server Configuration Manager” and open properties for the SQL server and enable Filestream.

When you have clicked “OK” and then open “SQL Server Management Studio”. Copy following script and execute it:

EXEC sp_configure filestream_access_level, 2

RECONFIGURE

Go
 
Now you can stop and start the SQL Server.

You should now be able to perform a full restore of the database file inriver.bak that follows the install package for inRiver Server.
 

Couple of notes before continuing
 

Note! SQL Server 2012
If you are running SQL Server 2012 integrated security it will not work "out of the box" like it does in SQL Server 2008, if you are running inRiver Server and SQL server on the same machine. You will then need to assign a specific user.

Note! User Account ID
In this solution it’s recommended to use an Active Directory User, since several servers are involved. If it’s on the same server you can use an administrator user.

Note! IIS on the inRiver server
Recommend to install Internet Information Services (IIS) on the inRiver server, since you will need this for inRiver Administration, inRiver WebClient and inRiver Web Media Browser. Also install Microsoft .NET Framework 4.0 or 4.5 if running Windows 2012 Server.

Installation of inRiver Server

Finally ready for installing the inRiver Server.

The installation procedure is very straight forward. Run installation file “Setup inRiver Server 5.3.exe”.  Proceed forward by clicking "Next" until the installation is finished. This will install the program as a service.

After installation, open Windows Explorer and point it to the root directory of your inRiver Server installation and rename inRiver.Server.exe.config.sample to inRiver.Server.exe.config

When you open the file in an editor, modify the text that’s inside the red square with either one of the two lines below the picture depending of which sql you use.


 
Connection string for sql 2008
<add name="inriver" connectionString="Data Source=localhost\INRIVERSERVER;Initial Catalog=inriver_demo;Integrated Security=True;" providerName="System.Data.SqlClient">


<add name="inriverResources" connectionString="Data Source=localhost\INRIVERSERVER;Initial Catalog=inriver_demo;Integrated Security=True;" providerName="System.Data.SqlClient">


Connection string for sql 2012
Create a sql user that has DBO rights in the database first.

<add name="inriver" connectionString="Data Source= localhost\SQLSERVER2012;Initial Catalog=inriver;Integrated Security=SSPI;User ID=dbUserInriver;Password=xxxxxx" providerName="System.Data.SqlClient" />


<add name="inriverResources" connectionString="Data Source= localhost\SQLSERVER2012;Initial Catalog=inriver;Integrated Security=SSPI;User ID=dbUserInriver;Password= xxxxxx;" providerName="System.Data.SqlClient" />


Note that in large installations you can point "inriver" and "inriverResources" into two different instances.

MSMQ

The first pitfall coming up, MSMQ.

Make sure changes to the service Log On properties are made prior to the first start attempt of the service. Else MSMQ queue objects might be created with inappropriate credentials. Check trouble shooting below, if you run into trouble.

Installing MSMQ is easy enough. Go to Server Manager and add click on “Add a feature”, then add and install “Message Queuing Services”.

After installation you can open Computer Management. Under "Services and Applications" you will now have a "Message Queuing". All queues later on will be created under "Private Queues".


Trouble shooting MSMQ

If the MSMQ queue objects are created with inappropriate credentials, you would have to delete the queue. There are 2 ways of doing that.
  1. In computer management, go to the security properties of the queue, take ownership through the advanced button, and set permissions to what you want. 
  2. Find the queue config file in the system32\msmq\storage\lqs directory and delete the file; the queue name will be inside the file you want. When you restart the MSMQ service, the queue will have disappeared.

Services

Before you start the service make sure you have added an AD user to the Log On for the service.
 
After you have installed and finished the configuration, then you can start the service.
 

If any trouble should occur you will be able to read more about the details in the Log. If the service doesn’t start and you don’t get any errors in the log it might be credential error. Then make sure you use the correct AD user and delete the “serverinternallog” instance in Private Queues, before restarting the service.


Testing out inRiver with the Rich Client editor

When the inRiver Server is up and running you can connect to it with the inRiver Rich client editor.
The installation procedure is very straight forward. Run installation file “Setup inRiver Rich Client”.  Proceed forward by clicking "Next" until the installation is finished. If you have installed this on the inRiver Server, you can use the “localhost:8080” to logon to the system. This require ofcourse that you have installed the Rich Client editor on the inRiver Server. 
 
If you want to access the inRiver Server from outside the server you most likely would have to set a new Inbound rule in the inRiver server. You will find that under Server Manager -> Configuration -> Windows Firewall -> Inbound rules. Choose Port and specify 8080.

You could then for example  use  <machinename or DNS: 8080> as the server address to be able to log on. Click on "Test Connection" to check if the connection work, if not, the inbound rule isn't setup correct.
 

 
When everything is in order you should be able to work inside the Rich Client editor.

 
Next blog post will go more into depth on how you setup a connect from the PIM solution to EPiServer Commerce:  http://sveinaandahl.blogspot.no/2014/04/how-to-connect-pim-system-to-episerver.html

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.