Tuesday, December 1, 2015

Sitecore 8: Upgrade EXM 3.1 Update 1

In this blog post I'll explain how to upgrade the EXM to version 3.1 update 1.

Requirements:
1. Sitecore 8.0 rev. 150621 (Update-4) / Sitecore 8.0 rev. 150812 (Update-5).
2. Email Experience Manager 3.1.1 rev. 150811.update file.

You can download this from here. (You may require the permission to download this update).

1. Pre-Installation

1.1. Disable the following configuration files:
 Sitecore.EmailCampaign.config file.
 Sitecore.EmailCampaign.Speak.Server.Requests.config file.
 Sitecore.EmailCampaign.UI.config file.
 Sitecore.EmailCampaign.Dedicated.config file.
 Sitecore.EmailCampaign.Xtune.CD.config file.
 Sitecore.EmailCampaign.Xtune.Processing.config file.

1.2. Disable all scheduled tasks at the following locations:
 /sitecore/system/Tasks/Schedules/Email Campaign
 /sitecore/system/Modules/E-mail Campaign Manager/Tasks

NOTE: To disable the scheduled task, go to the task and clear the value in the 'Schedule' field in the item's Data section. (See image bellow)



1.3 Detached the Sitecore.EXM database (which is defined in the ecm.dispatch connection string)
NOTE: This is not available in Sitecore 7.5 and Sitecore 8.0. So if you are running on one of these versions you can skip this step.

1.4. If you are running on Sitecore 8.0 update 5 add the following configurations to your web.config file. (Else skip this step as well).

<dependentAssembly> 
   <assemblyIdentity name="MongoDB.Driver" publicKeyToken="f686731cfb9cc103" /> 
   <bindingRedirect oldVersion="0.0.0.0-1.8.3.9" newVersion="1.10.0.62" /> 
</dependentAssembly> 
<dependentAssembly> 
   <assemblyIdentity name="MongoDB.Bson" publicKeyToken="f686731cfb9cc103" /> 
   <bindingRedirect oldVersion="0.0.0.0-1.8.3.9" newVersion="1.10.0.62" /> 
</dependentAssembly>


2. Upgrade Installation

2.1. Go to the following URL.
http://<your_host_name>/sitecore/admin/UpdateInstallationWizard.aspx

2.2. Click 'Chose Package'



2.3. Select the package using the 'Brows' button. And continue by clicking on 'View package information'.


Then it will show you the package information.


Continue by clicking on 'Analyze and install the package'.

2.4. It is always better to analyse the package before install. Or you can directly click on Install.


If you select 'Analyze', it will show the details and click on 'Analysis results'.

This will show the problems with the analysis process. You need to look for red, blue and yellow signs.



2.5. Click on 'Install the package'.


2.6. You can check for the problems and if you feel ok you can close this page now.

3. Post-Installation 

After installing the update package, you should perform the following post-installation steps. Some of them can be already done for you. You just need to check every thing is ok.

3.1. Attach the Sitecore_Exm database to SQL server.
NOTE: You can find the file in the Data folder or, alternatively, in the Website\temp\ECM folder.

3.2. In the App_Config\ConnectionStrings.config file, add the SQL server connection string exm.dispatch
NOTE: Don't delete or overwrite the existing ecm.dispatch connection string because we need it to migrate the old data to the new database. (Migrate data from EXM monboDB to SQL database)

3.3. To migrate your existing email campaign data to SQL server, go to following URL.
http://<your_host_name>/sitecore/admin/MigrateCampaignData.aspx
If you don't have any data to migrate you can skip this step.

3.4. Now you can delete the old ecm.dispatch connection string in the /App_Config/ConnectionStrings.config file.

3.5. In the \App_Config\Include\EmailExperience\Sitecore.EmailExperience.Core.config file, replace the entire <ecmDataProvider defaultProvider="mongo"> section with the following section:

<ecmDataProvider defaultProvider="sql"> 
   <providers> 
      <clear/> 
         <add name="sql" type="Sitecore.Modules.EmailCampaign.Core.Data.SqlDbEcmDataProvider, Sitecore.EmailCampaign" connectionStringName="exm.dispatch"/> 
   </providers> 
</ecmDataProvider>

3.6. Remove the EXM httpHandler and handler sitecore_ecm_speak_request.ashx from the web.config file. (Simply delete the lines)

3.7. Remove the following files from all instances of EXM :
sitecore\shell\client\Applications\ECM\EmailCampaign.Client\Pipelines\UpdateMessagevariant\UpdateVariant.js
sitecore\shell\client\Applications\ECM\EmailCampaign.Client\Pipelines\UpdateMessagevariant

NOTE: Steps 3.5 and 3.7 might already done for you.

3.8. Your custom settings are not automatically ported to the new configuration file. If you have used any custom settings in the previous version and you want to apply them to EXM 3.1, make the necessary changes to the Sitecore.EmailExperience.ContentManagement.config file manually.

Ok, we are done with the installation.

4. Set the SMTP settings

In the Sitecore.EmailExperience.ContentManagement.config file set the smtp settings by changing the following configurations.

      <!-- SMTP server address (IP). -->
      <setting name="SMTP.Server" value="localhost" />

      <!-- Port number of the SMTP server. -->
      <setting name="SMTP.Port" value="25" />

      <!-- Domain for logging into SMTP server. -->
      <setting name="SMTP.LoginDomain" value="" />

      <!-- User name for logging into SMTP server. -->
      <setting name="SMTP.UserName" value="" />

      <!-- Password for access to SMTP server. -->
      <setting name="SMTP.Password" value="" />



Wednesday, November 18, 2015

Sitecore 8 - Document Manager is blank in Rich Text Editor

Environment: Sitecore 8.0 rev 150621

Sitecore Rich Text Editor allows to link a document to a link. So the idea is to download the linked document when the particular link is clicked.
To link the document you have to use the Sitecore Rich Text Editor (RTE). But when you trying to link the document using the Document Manager in the Sitecore RTE it is blank as bellow.



I have raised a Sitecore support ticket and this issue reported as a bug in Sitecore.

They have provided the following workaround to overcome this issue.

1. Open the /Website/sitecore/shell/Controls/Rich Text Editor/EditorPage.aspx file
2. Find the following text part and replace it:

MediaManager-ViewPaths="/media library"
TemplateManager-UploadPaths="/media library"

with this one:

MediaManager-ViewPaths="/media library"
DocumentManager-DeletePaths="/"
DocumentManager-ViewPaths="/"
TemplateManager-UploadPaths="/media library"

3. Clear browsers cache and try the issue again.
Let us know if you have any issue with the Document Manager.



Tuesday, November 17, 2015

SItecore 8 - Solve 'The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel' error

When I work with Sitecore, I build Sitecore link databases to avoid some errors causing in our environment. But after building the core, master and web database links using the Sitecore Launchpad --> Control Panel --> Rebuild link databases I got the following error when I try to log in to the Sitecore back-end.

The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel', but this dictionary requires a model item of type 'Sitecore.ExperienceAnalytics.Client.Mvc.Presentation.ExperienceAnalyticsLineChartViewModel'.

The reason for this issue is Sitecore does not clear the cache after it builds the link databases.
To solve this issue, do the following steps:
1. Login to the http://{your website}/sitecore/admin/cache.aspx
2. 'Clear all' cache.
3. Restart the website from IIS

But this a temporary solution.
I'm experience this issue time to time.
So when this error is throwing you have to redo the above steps.

Update

I created a Sitecore support ticket sine this error getting annoying and they provide a fix with some item changes. It include item changes in the core database.
If this problem arise in your environment I think it is better to raise a Sitecore support ticket with your databases.

Until Sitecore support come with a solution...

Don't worry, you don't have to be blocked with this.
In my case this error came in the Sitecore launch pad. So I was able to bypass the launchpad when I log in to the Sitecore by using the http://{website name}/sitecore/shell url.











Thursday, November 12, 2015

Sitecore 8: GeoIp not picking City, Region and Country

Environment: Sitecore 8.0 rev 150621

When we are testing our site to get visitor details, GeoIp does not tack City, Region and Country details of UK visitors. But visits received from Sri Lanka get the City, Region and Country details.

The reason for this is our QA visit the site from our internal network (the same network which our website is hosted).
Sitecore GeoIp does not track the City, Region and Country visits for the users coming from the internal networks.

To check this you can use an IP changing tool like Hide My Ass or Freedom.

Wednesday, November 4, 2015

Sitecore - Delete current version from an Item using Workflow Action

Current Environment: Sitecore 7.2 rev 140526

Requirement:
  • Need to remove the selected language from the item.
  • Need to remove it using the Sitecore Workflow Action 

Sitecore Step 1: Create a workflow action within the workflow which is set to that item template.

Create a workflow. (I used the default sample workflow).
You can find how to create the workflow action in sitecore cookbook: http://sdn.sitecore.net/upload/sitecore6/workflow_cookbook_a4.pdf. 

Sitecore Step 2: Provide Type String

Select the created workflow action.
In the Type String field provide the following details.
namespace.class_name, dll_name 

Do the following code for the class (.dll)

Coding:

     public class DeveleVersion
    {
        public void Process(WorkflowPipelineArgs args)
        {
            Item item = args.DataItem;
            
            Database db = Sitecore.Context.ContentDatabase;

            if (db == null || item == null) return;
            if (item.Versions.Count <= 0) return;
            using (new Sitecore.SecurityModel.SecurityDisabler())
            {
                item.Versions.RemoveVersion();
            }
            args.AbortPipeline();
        }
    }





Tuesday, November 3, 2015

Sitecore 8: Unable to add Enroll in Engagement plan save action to a Sitecore WFFM form

Environment: Sitecore 8.0 rev 150621

Whn I was working on Sitecore WFFM (Web Forms For Marketers) forms and save actions I got the following issue.
When I try to add Enroll in Engagement plan save action I got a Sitecore error saying "This action cannot be added. Your configuration does not support it."


This is happening because of 'Disable Analytics for this Page' setting in the Sitecore WFFM.
You can check this setting on the Advanced section in your WFFM form Content.



You can disable this setting by clicking on the 'Attributes' link.
Then go to the Settings section. Remove the check on 'Disable analytics for this page' check box.


Try to add the 'Enroll in Engagement Plan' save action. It will be added to the form save action list without getting the above error message.


Monday, November 2, 2015

Sitecore 8 - Check Item's created and last updated days

Environment: Sitecore 8.0 rev 150621

Sometimes you need to check when is a specific Sitecore item has been created or edited.
You don't have to worry about these things because Sitecore save these for you.

You can view item's following details:
1. Item created date.
2. User who created that item.
3. Revision of the item.
4. Last updated date of the item.
5. User who did the last update to the item.

To view the above details follow the following steps:
1. Go to the item you want.
2. Go to the 'View' section in the ribbon and make sure the 'Standard fields' check box is selected. (See image bellow)


3. Scroll down in the item's content section until you find the 'Statistics' section. Expand this and you can view the details mentioned above.