Dieses Blog durchsuchen

Montag, 7. Dezember 2015

Sitecore Upgrade fom 6.6 to 8.0 Update 5. Our Sitecore 8 Upgrade Experience

Intro:

We have a small and nice website with three languages and many pages, products, forms, videos and images on it to migrate from an old Sitecore 6.6 to a Sitecore 8.0 Update five instance.

Sonar state before migration:

This is the code quality state:
Sonar state before migration:

How to migrate:

Option 1:

Jump from 6.6 to 7.0 Initial release and from
7.0 rev 130918 to 7.1 rev 130926
7.1 rev 130926 to 7.2 rev 140228
7.2 rev 140228 to 7.5 rev 141003
7.5 rev 141003 to 8.0 rev 141212
8.0 rev 141212 to 8.0 rev 150427

This is the official way, but for me way too long.

Option 2:
Do a Sitecore package with data templates, config, branches, content items,... all you need for the new site. Move the code solution to a new git repository and make it better,
Special case for files and videos: Use serialization.

My Learnings:

- export large data with serialization
- partial language fallback: Never set checkbox "Enable fallback" field in standard values --> causes infinite loop
- ashx fileextension  in media link  --> support helps with that: https://kb.sitecore.net/articles/998758

Sonar state before migration:

This will be getting even less.



Dienstag, 1. Dezember 2015

Sitecore: language fallback

Intro:


In Switzerland we have 4 official languages. So language Fallback is a topic in every project here. I am so happy the in Sitecore 8.1 we meet new Language Fallback features. Till now we were using the partial language Fallback module of Alex Shyba.

Here is the most extensive blogpost series about this topic:
http://www.sitecore.net/learn/blogs/technical-blogs/elizabeth-spranzani/posts/2014/10/fallback-followup.aspx

Addition helpfull stuff:

http://sitecoremadness.blogspot.ch/2015/04/language-fallback-word-of-caution.html

https://nsgocev.wordpress.com/2015/03/16/language-fallback-module-endless-fallback-problem-fix/

Mittwoch, 18. November 2015

Sitecore Schedule: XML Sitemap of Pages for Google

Intro:

As you might know google and other search engine bots are looking for XML Sitemaps of you page to index your pages faster. To generate such a XML sitemap we use a scheduler task to generate this XML sitemap. 

All about scheduler task in Sitecore find here:

How to generate a XML Sitemap:


Montag, 2. November 2015

Sitecore: How to improve code quality with sonarqube

Intro:
I learned about the great tool sonarqube from my time with Java. It is an awesome tool to check your code quality and control hopefully your code quality improvements. I will share my experiences about it. Also its being the topic of the Sitecore Usergoup Switzerland. See here the slideshow from this presentation:


Setup Sonar:
The setup is really easy if you run it standalone. Just follow the steps in here.

Setup Sonar & Jenkins:
If you have a running Jenkins just add to your Job a Windows batch file element and past in that:

cd C:/Program Files/Jenkins/jobs/<jenkins job name>/workspace
C:\Programs\sonar-runner-2.4\bin\sonar-runner.bat -X -Dsonar.login=admin -Dsonar.password=password


Replace  <jenkins job name> with the Job name. Don’t change it because Jenkins uses it as folder name. Of Course adjust the path to your environment.

BTW: the -X parameter is for verbose log information the sonar-runner is executed.

My recommendations:
- 0 % duplication is a must
- No critical or blocker bug allowed

Outlook
Especially for Sitecore:  Do not fight the framework. So there are additional FXcop rules to implement. Find them here:


Montag, 5. Oktober 2015

Sitecore search: How to use Spell correction / suggestion in Sitecore with Lucene.NET


Recently our client asks us to extend the search feature with a spell check and provide suggestions. After some search I found some code that help me to bring the feature live. Thanks to tanasuk.

See the small method code here:

 public static String[] GetSpellCorrectionSuggestions(string searchTerm, int numberOfSuggestions = 5)

        {
            string[] suggestions = null;

            if (string.IsNullOrEmpty(searchTerm))

            {
                return null;
            }

            try
            {
                string indexPath = string.Format("{0}\\{1}\\", Sitecore.Configuration.Settings.IndexFolder, ConfigurationHelper.GetIndexName());
                Lucene.Net.Index.IndexReader reader = Lucene.Net.Index.IndexReader.Open(

                    FSDirectory.Open(indexPath), false);

                SpellChecker.Net.Search.Spell.SpellChecker speller =
                    new SpellChecker.Net.Search.Spell.SpellChecker(new RAMDirectory());

                speller.IndexDictionary(new LuceneDictionary(reader, "_title"));
                suggestions = speller.SuggestSimilar(searchTerm, numberOfSuggestions);
                reader.Dispose();
                return suggestions;
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error(ex.Message, ex, Sitecore.Context.Item);
                return suggestions;
            }
        }

Freitag, 2. Oktober 2015

sitecore [branch no longer exists]

Problem:

[branch no longer exists] - 





Solution

If items were created from template, 'MasterId' field has '00000000-0000-0000-0000-000000000000' value. MasterId field in SQL database is responsible for 'created from'. Update MasterId field to 00000000-0000-0000-0000-000000000000.


How to SQL command:

Do a backup. 
Be careful, use your own query and use filter.
update [your_db_name_master].[dbo].[Items] set MasterID = '00000000-0000-0000-0000-000000000000' where TemplateID = '<your TemplateID>'


Donnerstag, 24. September 2015

job in checkstatus

Solution:

Do a Sitecore upgrade.

https://community.sitecore.net/developers/f/5/t/215
http://sitecorefootsteps.blogspot.ch/2015/03/why-not-to-upgrade-to-sitecore-80.html


Server Error in '/' Application.

job in checkstatus

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: job in checkstatus

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: job in checkstatus]
   Sitecore.Shell.Applications.Dialogs.Progress.ProgressPage.CheckStatus() +274

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +155
   Sitecore.Web.UI.XamlSharp.Xaml.XamlControl.ExecuteAjaxMethod(AjaxMethodEventArgs e) +72
   Sitecore.Web.UI.XamlSharp.Xaml.XamlControl.Sitecore.Web.UI.XamlSharp.Ajax.IIsAjaxEventHandler.HandleMethodEvent(AjaxMethodEventArgs e) +33
   Sitecore.Web.UI.WebControls.AjaxScriptManager.DispatchMethod(Control control, String parameters) +287
   Sitecore.Web.UI.WebControls.AjaxScriptManager.Dispatch(String clientId, String parameters) +303
   Sitecore.Web.UI.XamlSharp.Ajax.AjaxContinuationProcessor.Invoke(PipelineArgs args) +367
   Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +222
   Sitecore.Pipelines.Pipeline.Resume() +38
   Sitecore.Pipelines.Pipeline.DoStart(PipelineArgs args) +115
   Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +169
   Sitecore.Web.UI.WebControls.ContinuationManager.RunPipelines() +259
   Sitecore.Web.UI.WebControls.ContinuationManager.OnPreRender(EventArgs e) +307
   System.Web.UI.Control.PreRenderRecursiveInternal() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249

Mittwoch, 9. September 2015

Sitecore hardening: Master2web.config for Sitecore 8 [SOLVED]

Intro

In Sitecore 8 we have way more config files then in any other Sitecore version. When creating the deployment package for delivery instance we use a Hardening.targets file for the tranformation.

See here our Hardening.targets on github if you are to lazy to type all that.

Based on: https://doc.sitecore.net/sitecore%20experience%20platform/xdb%20configuration/configure%20a%20content%20delivery%20server

Solr stuff is NOT included as we do not use it for now!

https://github.com/thwittek/Sitecore-Hardening/blob/master/Hardening.targets


Freitag, 21. August 2015

Sitecore: Could not find property 'DefaultIndexConfiguration' on object of type: Sitecore.ContentSearch.ContentSearchConfiguration [SOLVED]

Solution:

My solutions was to delete the Sitecore.Support.394688.config. Also the corresponding dll is not needen anymore.
This issue appeared while upgrading Sitecore from 7.0 to 7.2!!!
Hope this helps!

Problem:

Server Error in '/' Application.

Could not find property 'DefaultIndexConfiguration' on object of type: Sitecore.ContentSearch.ContentSearchConfiguration

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find property 'DefaultIndexConfiguration' on object of type: Sitecore.ContentSearch.ContentSearchConfiguration

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Could not find property 'DefaultIndexConfiguration' on object of type: Sitecore.ContentSearch.ContentSearchConfiguration] Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +1646 Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +523 Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +198 Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +298 Sitecore.Configuration.Factory.CreateObject(String configPath, Boolean assert) +38 Sitecore.ContentSearch.Abstractions.FactoryWrapper.CreateObject(String configPath, Boolean assert) +11 Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +168 Sitecore.ContentSearch.ContentSearchManager.GetIndex(String name) +18 Intranet.Website.Logic.Search.ItemSelector.get_Index() +77 Intranet.Website.Logic.Search.ItemSelector.GetResults(Expression`1 predicate, String sort, Boolean reverse, Int32 start, Int32 count, Boolean neglectPermissions) +7837 Intranet.Website.Logic.Search.ItemSelector.GetItems(BaseSearchParameter param, String sort, Boolean reverse, Int32 start, Int32 count) +4991 Intranet.Website.layouts.sublayouts.buho.Portlets.SearchListPortlet.Page_Load(Object sender, EventArgs e) +4988 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446



Montag, 20. Juli 2015

SEO FRIENDLY URLS IN SITECORE – PREVENTION IS BETTER THAN CURE

Originally posted on jammykam:
I’ve seen a fair number of posts already on SEO Friendly URLs, search engines love them apparently and as humans we love them too – although it could be argued that it is mainly for vanity reasons

Whatever the argument, we agree that Semantic URLs are a good thing for us mere mortals and the vast majority of sites.

View original 2,039 more words

Dienstag, 14. Juli 2015

6 Best practices for sitecore information architecture.


My suggestions to have a stable information architecture following this rules:

  1. Reference items by ID. Way better to move and rename items. While wokinge in the user interface pathes are more readable.
  2. Never use same key in data templates. Keep in mind the this might happen when using inheritance.
  3. Follow max. 100 items under a single item. Create subdirectories und organize them.
  4. Use Lucene search instead of (Fast) Sitecore queries (= SQL calls affect perfomance)! 
  5. Avoid branch templates that can change over time. Branch template don't reflect those updates.
  6. Rich Text Editor. Help Content authors to focus on content, not presentation and never on markup. Use provides Sitecore RTE Profiles: e.g./sitecore/system/Settings/Html Editor Profiles/Rich Text Default
...
There are way more tips, but those here will help in a first row.


Dienstag, 7. Juli 2015

Sitecore: Edit Items without modifying Statistics.

Sometime we modify item via codebehind with a scheduler,.... but we don't want to update the standard field "updated" and "updated by" to not falsify the value in there.

For this case I found a intersting option in the EditContext method. Set the second parameter to false if you want to avoid updating statics.



  1. using (new EditContext(item, falsefalse))  
  2.         {  
  3.             item["Title"] = "new Title";  
  4.         }  

Donnerstag, 18. Juni 2015

SBOS Sitecore Business Optimization Services started in DACH region

For those who missed the webinar. Sitecore DACH started the SBOS services in the DACH region. I am very happy about that. Session from Christopher Nash are my highlight on Sitecore events.




Check out some cool slides from this webinar.









Mittwoch, 10. Juni 2015

Sitecore: An instance of Sitecore.Data.Items.Item was null. Additional information: Failed to find the root item "/".

This one was my vault. I tried to get rid for the viewstate to gain speed. So I disabled Viewstate for the whole website and sitecore backend via web.config.

The better solution is to do it in Codebehinf or in the ASCX files.

In ASCX files:


<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="true" CodeBehind="WebService.ascx.cs"  Inherits="ICR..WebServices.WebService" %>


In code behind :

Do it like this:

protected void Page_Init(object sender, EventArgs e)

        {

            this.EnableViewState = false;       

        }




Server Error in '/' Application.

An instance of Sitecore.Data.Items.Item was null. Additional information: Failed to find the root item "/".

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: An instance of Sitecore.Data.Items.Item was null. Additional information: Failed to find the root item "/".

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: An instance of Sitecore.Data.Items.Item was null. Additional information: Failed to find the root item "/".]
   Sitecore.Web.UI.HtmlControls.DataContext.GetState(Item& root, Item& folder, Item[]& selected) +1404
   Sitecore.Web.UI.HtmlControls.DataContext.GetRoot() +39
   Sitecore.Shell.Applications.ContentManager.ContentEditorForm.OnLoad(EventArgs e) +1553

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +155
   Sitecore.Reflection.ReflectionUtil.CallMethod(Type type, Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Boolean includeStatic, Object[] parameters) +141
   Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +395
   Sitecore.Shell.Web.UI.SecurePage.OnLoad(EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249

Dienstag, 9. Juni 2015

Sitecore: Package generation failed Root element is missing

Recently I had this error on a new, fresh environment while dealing with packages:

"Package generation failed Root element is missing"

Solution:


Give access rights to temp folder. Or lets say allow IIS user to write in there. This solved it for me.


Error:

Package generation failed Root element is missing



Dienstag, 2. Juni 2015

Sitecore 7: Exception of type ‘Lucene.Net.Index.MergePolicy+MergeException’ was thrown.

Intro

Recently I got this  error, Exception of type ‘Lucene.Net.Index.MergePolicy+MergeException’ was thrown, in our log files. This was a Sitecore 7 site, rev. 140905.

First try and error punsh was to delete the files in the indexes folder ("sitecore_master_index") and rebuilding the index. Suprisingly the issue went away. Rebuiling usefull on a dev machine...

Here the error log entry:

Lucene Merge Thread #0 14:54:38 ERROR Unhandled exception detected. The ASP.NET worker process will be terminated. 
Exception: Lucene.Net.Index.MergePolicy+MergeException
Message: Exception of type 'Lucene.Net.Index.MergePolicy+MergeException' was thrown.
Source: Lucene.Net
   at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(Exception exc)
   at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Montag, 4. Mai 2015

Sitecore pricing: Fighting the jungle.



Today I want to share some slides from a Sitecore DACH webinar regarding the new pricing of Sitecore. To not disappoint readers I will not show any numbers and prices. There was no confidential information during the webinar but still I assume there is one. This post is just to understand the different price models and server types. I plan to build a small and easy calculation form to help you to choose that model that fits best to your customer. Keep in mind that your customer’s platform may grow and in 1 or 2 years you need more dev workstations, user CALs, testing environments and modules. It might be useful to choose a bit bigger and future safe model.

Another abbreviation information:
CM = Content management = this is the authoring environment where editors put content in.
CD = Content Delivery = this are the publishing instances. If you have a lot of traffic on you website you can put n pieces of those servers. A default server architecture has 1 CM and 2 CDs.

The webinar began with the challenges that Sitecore faces:



Guiding principles for platform pricing

·        Upgrades should be driven by production requirements, not by development. (so true)
·        Same price for CM and CD
·        Enterprise should get a lot MORE 


Price matrix:





Comments regarding max. Prod Installs:


Primary Plus
1 CM and 1 CD. Having 2 CD is not always needed. Depends on the traffic you expect.

Pro and Pro Plus
1 CM and 2 CDs. This is the classical architecture.
Enterprise
For example: 1 CM in Europe and 1 CM in China paired with 2 CDs each.


Comments regarding max. Non-Prod Installs:


By non Non Prod are meant DEV, INT, TEST, Staging,… environments. In smaller projects may one Test or Staging server environment is enough. But if you have only one license for those CM and CD are on the same server! This is possible but for testing, publishing and lucene index rebuild sometimes not ideal. To have a real 1:1 Prod and testing environment choose Pro Plus license model.




Comments regarding Domains included:


Multi domain strategy:
The rule of thumb is your content tree. If you have 5 website roots below /Sitecore/content/ you go with Pro plus or even enterprise license. In that case you have dedicated websites for different or similar purpose and different layout and /or shared modules.

One domain strategy:
If you have one .com domain e.g. example.com with 18 languages as your central digital footprint entry point. Also you have 50 “redirect” domains like example.de, example.ch. example.es,…that point to the .com domain. In that I case, those redirect domains are NOT counted as domains. You can go with Primary Plus license. That’s how I understood it. Happy about any constructive feedback or comment.

Comments regarding Dev Workstations included:


If your solution is implemented by a Sitecore Partner e.g. Infocentric, you don’t care about this point. If you plan to develop by your own with the internal IT you need to care about this. Keep in mind the cost for a at least minimum 4 days developer training for your IT people.

New Server types







Azure Platform as as Service Diagramm





Final:

If you have any feedback, complains, comments let me now. I happy about learning or and productive discussion.