Publishing Target missing Issue while publishing content

You might have experienced this issue where the publishing target is missing while publishing the content as below.


There is a very easy solution to this issue – grant a language:read permission to “/sitecore/system/Languages/en” for the base/root user so that all users can get this access.


Hope this works for you too.


How to move and rename Items from Source to Destination path in Sitecore using Sitecore PowerShell

Here is the simple script for this:

# database name

$db = “master:”

# source path

$sourcePath = “/sitecore/content/Generic Content/Generic Pages/Basic Generic Item”

# destination path – task was to move the generic pages from generic location to country based locations

$destinationPath = “/sitecore/content/USA/Generic Content/Generic Pages/Basic Generic Item”

$itemsList = Get-ChildItem -recurse -Path ($db + $sourcePath) | Where { $_.TemplateName -eq “Generic Pages” }

$itemsList | ForEach-Object {

# task was to append parent name to the new item

$newName = $_.Name + “-” + $_.Parent.Name


Move-Item -Path $_.ProviderPath -Destination ($db + $destinationPath + “/” +                    $newName)

Write-Host “Moved Item: ” $newName  ” to path: ” ($db + $destinationPath)


Write-Host “Could not move Item: ” $newName



How to handle and configure Sitecore Launch Pad Buttons, sections, sort order and grouping

Please have a look at the Sitecore Launch pad with lots of buttons.

These buttons can be configured to show and hide based on users and roles.

Lets take an example and say that we have a role – configmanger which is responsible for managing lot of configurable items including this launch pad.


First of all switch to CORE database and go to this location – /sitecore/client/Applications/Launch Pad/PageSettings/Buttons

You can add new buttons here and also control the grouping and order of the buttons and the link which will open on clicking the button.

E.g. Suppose if you want to show 2 separate buttons to show English and French Content you can create 2 buttons in the location – /sitecore/client/Applications/Launchpad/PageSettings/Buttons/ContentEditing

Name these 2 buttons as English Content and French Content and set their title, link properties to define the title and the link where it will go to when clicked.

capture 2

Also do not forget to assign a READ permission to the 2 buttons paths for the role – configmanager.

capture 3

Now you can see 2 additional buttons on Launch pad in Content Editing sections.

capture 4

If you want to remove these 2 buttons simply revoke – configmanager roles permission on these 2 button paths. See below both buttons are missing now.

capture 5

Hope this article helps you in configuring the launch pad.

Get Rid of Extra HTML Tags(e.g p tags etc) from the Rich Text Editor while saving

Method 1: Override and disable the filters as needed

Step 1: Update the following config setting:

<settings xmlns:patch=””&gt;

<setting name=”HtmlEditor.DefaultConfigurationType“>

<patch:attribute name=”value”>YourProject.Custom.Controls.CustomRichTextEditor, YourProjectDLLName </patch:attribute>




Step 2: Override Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration as below:

using Sitecore.Data.Items;

using Telerik.Web.UI;

namespace YourProject.Custom.Controls


public class CustomRichTextEditor : Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration


public CustomRichTextEditor(Item profile)

: base(profile)




protected override void SetupEditor()





Editor.StripFormattingOptions = EditorStripFormattingOptions.MSWordRemoveAll

| EditorStripFormattingOptions.ConvertWordLists

| EditorStripFormattingOptions.Css

| EditorStripFormattingOptions.Font

| EditorStripFormattingOptions.Span;

Editor.NewLineMode = EditorNewLineModes.Br;





Method 2: Override and remove the tags as needed

Step 1: Update the following config setting:

<settings xmlns:patch=””&gt;

<setting name=”HtmlEditor.DefaultConfigurationType“>

<patch:attribute name=”value”>YourProject.Custom.Pipelines.ProcessRichTextInParagraphOnRender, YourProjectDLLName </patch:attribute>



Step 2: Override Sitecore.Shell.Controls.RichTextEditor.EditorConfiguration as below:


namespace YourProject.Custom.Pipelines


public class ProcessRichTextInParagraphOnSave


public void Process(SaveRichTextContentArgs args)


if ((args.Content.Trim().StartsWith(“<p>”) && args.Content.Trim().EndsWith(“</p>”)))

args.Content = string result = Regex.Replace(HttpUtility.HtmlEncode(args.Content), @”</?p\b.*?>”,





A list of filters are listed in Telerik’s documentation –


Sitecore PowerShell Common Utilities

Below are some Sitecore PowerShell Common Utilities:


# Get a list of all Sitecore users

$lstSitecoreUsers = Get-User -Filter “sitecore\*”

$lstSitecoreUsers | ForEach-Object  {

Write-Host $_.Name



# Get a list of Admin users only

$lstSitecoreUsers = Get-User -Filter “sitecore\*”

$lstSitecoreUsers | Where{$_.IsAdministrator -eq $true } | ForEach-Object  {

Write-Host $_.Name



# Get a list of users who are managers

$lstSitecoreUsers = Get-User -Filter “sitecore\*”

$lstSitecoreUsers | Where{$_.Name -like “*manager*” } | ForEach-Object  {

Write-Host $_.Name



# Get a List of all items under a node – e.g Home

$allItemsUnderHome = Get-Item master: -Query “/sitecore/content/Home//*”

$allItemsUnderHome | ForEach-Object {

Write-Host “Item name: ” + $_.Name



# Update an Item – e.g. Test Items under Home

$item = Get-Item “master:/sitecore/content/Home/Test”


$item[“Header Title”] = “New title for the test item here”;



# Get a list of items update in last ‘x’ number of days e.g 30 days

Get-Childitem -Path “master:/sitecore/content/Home”  -recurse |

Sort $_.”__Updated” |

Where-Object   {  $_.”__Updated” -gt (Get-Date).AddDays(-30) }


# Show results in a List View – Get a list of items update in last ‘x’ number of days e.g 30 days

get-childitem -Path “master:/sitecore/content/Home” -recurse | `

Sort $_.”__Updated” | `

Where-Object   {  $_.”__Updated” -gt (Get-Date).AddDays(-30) }    |

Show-ListView -property Name, `

@{Label=”Last Updated Date”; Expression={$_.”__Updated”}}, `

@{Label=”Last Updated By”; Expression={ $_.”__Updated By” } } `

-Modal -Width 690 -Height 600 -PageSize 200

Show-Result -Text


# Find and Replace – e.g. Find all items under Home with template ‘Generic Page’ and update/replace their ‘Header Subtitle’ with ‘Header title’

Get-Childitem -Path “master:/sitecore/content/Home” -recurse `

| Where-Object { $_.TemplateName -match “Generic Page”  } `

| ForEach-Object { $_.”Header Subtitle” = $_.”Header Title”}


# Remove or Create Users, setting user permissions(adding and removing permissions)

$usr =”sitecore\testuser001.admin”;

Remove-User -Identity $usr -ErrorAction SilentlyContinue;

New-User -Identity $usr -Enabled -Password “testpwd001” -Email “” -FullName “Test User 001” -ErrorAction SilentlyContinue;

Set-User -Identity $usr -IsAdministrator $true;

ForEach-Object {

Remove-Rolemember -Identity $_ -Members $usr -ErrorAction SilentlyContinue;

Add-Rolemember -Identity $_ -Members $usr -ErrorAction SilentlyContinue;



# assign specific security rights to an item
$theHeader = Get-ChildItem -Path “master:/Sitecore/Content/Header” -ErrorAction SilentlyContinue

if($theHeader -ne $null) {
@(“item:create”,”item:write”,”item:delete”,”item:rename”) | ForEach-Object {
$aclRight = $_

$acl1 = New-ItemAcl -AccessRight $aclRight -PropagationType Any -SecurityPermission AllowAccess -Identity “sitecore\Content Owner”
$acl2 = New-ItemAcl -AccessRight $aclRight -PropagationType Any -SecurityPermission AllowAccess -Identity “Content Author”

$theHeader | Add-ItemAcl -AccessRules $acl1,$acl2


# Compare/Count items in Sitecore databases(Master and Web)

$childsMaster = Get-ChildItem master:/sitecore/content/Catalog/Products -Language en-CA -Version *
$childsMaster= $childsMaster | Where { $_.ProductExpireDate -gt (Get-Date) } #| ForEach-Object {$_.ProductExpireDate}
write-host “Count of items Canada Product Catalog(Master): ” $childsMaster.length

$childsWeb = Get-ChildItem web:/sitecore/content/Catalog/Products -Language en-CA -Version *
$childsWeb= $childsWeb | Where { $_.ProductExpireDate -gt (Get-Date) } #| ForEach-Object {$_.ProductExpireDate}
write-host “Count of items Canada Product Catalog(Web): ” $childsWeb.length

#write-host “Compare master Vs Web Databases”
Compare-Object $childsMaster $childsWeb -PassThru


# Compare items in different master and Slave Solr

$items_product_index_master = wget “*&fq=_language%3Aen-US&rows=9999&fl=product_id&wt=json&indent=true&#8221; | ConvertFrom-Json
write-host “Count of items product_index_master: ” $items_product_index_master.response.numfound

$items_product_index_web = wget “*&fq=_language%3Aen-CA&rows=9999&fl=product_id&wt=json&indent=true&#8221; | ConvertFrom-Json
write-host “Count of items product_index_web: ” $items_product_index_web.response.numfound

#write-host “Compare product_index_master Vs product_index_web”
Compare-Object ($ ($


# Compare items in sitecore database and Solr

#write-host “Compare Master Database Vs product_index_web”
Compare-Object ($childsMaster.ProductID) ($ -PassThru

….more to continue…

How to monitor EC2, CloudWatch, EBS, RDS, ELB, ElasticCache using metrics

AWS is the front runners when it comes to have highly available, fault tolerant, secure and high scaling service which can integrate with almost everything in cloud as well as your own data center.

For monitoring your VPC(Virtual Private Cloud), AWS has these two very renowned services:
– CloudWatch and
– CloudTrail

While ‘CloudTrail’ is primarily used to monitor the API calls made to other services or Applications, ‘CloudWatch’ is used for monitoring and logging events periodically (default every 5 minutes, detailed every minute).

It can be used to monitor:
– Compute resources like EB2s, ELBs, Route53, Auto Scaling Groups,
– Storage & CDN resources like  S3, CloudFront, EBS Volumes,
– Database and Analytics services like DynamoDB, Elastic cache, RDS, Elastic MapReduce, Redshift
– SNS, SQS etc.
Let’s cover them one by one on how CloudWatch monitors different services:

A- EC2(Elastic Compute Cloud)

CloudWatch can monitor the following metrics:

# CPU 

– CPUCreditUsage (number of CPU credits consumed by the instance. One CPU credit equals one vCPU running at 100% utilization for one minute)

– CPUCreditBalance (number of CPU credits available for the instance to burst beyond its base CPU utilization, expire every 24 hrs)

– CPUUtilization (percentage of allocated EC2 compute units)

# Network

– NetworkIn (number of bytes received on all network interfaces by the instance)

– NetworkOut (number of bytes sent out on all network interfaces by the instance)

– NetworkPacketsIn (number of packets received on all network interfaces by the instance)

– NetworkPacketsOut (number of packets sent out on all network interfaces by the instance)

# Disk

– DiskReadOps (Completed read operations from all instance volumes)

– DiskWriteOps (Completed write operations to all instance store volumes )

– DiskReadBytes (Bytes read from all instance store volumes )

– DiskWriteBytes (Bytes written to all instance store volumes)

# Status Check

– StatusCheckFailed (Reports whether the instance has passed both the instance status check and the system status check in the last minute)

– StatusCheckFailed_Instance (whether the instance has passed the instance status check in the last minute.)

– StatusCheckFailed_System (whether the instance has passed the system status check in the last minute.)

– You can create alarms based on these above metrics to watch the health of the host and the instances.

Rest of the article to be continued…


How to manage website Failover using AWS Route 53 and a website hosted on an external domain


You have 2 websites:

  • “”, which is the primary website, is hosted on AWS EC2 Instance supported though an ELB(Elastic Load Balancer). Please keep in mind that is just the site registrar for the site name the site is not hosted there.
  • “”, which is the secondary/failover website is hosted on domain.
  • You are using Route 53 DNS service to resolve the domains.


  • “” should be the primary website and should run when the EC2 Instance is healthy.
  • In case of failover the external website “” becomes the failover website. The requests for “” should be routed to this external secondary website in case of the primary websites failure.


  • There can be various solutions. Let’s see them one by one.
  • Solution 1:
    • It is very primitive solution. Just write a domain forwarding rule on your registered websites domain manager panel. Any requests for “futureCloud.Technology” website will automatically be forwarded to “”
    • See snapshot below:
    • godaddy forwarding
    • Issue – this is a very basic solution and AWS Route 53 never comes into picture. It should be Amazon’s Route 53 which should dictate the failover logic not registrar.


  • Solution 2:
    • We will use AWS Route 53 to dictate the website failover from Primary to Secondary.
    • I am assuming the following:
      • That you created an AWS EC2 instance. (Ideally you create a couple of Instances hosting WordPress website and couple of MySQL Instances for your site to by highly available, fault tolerant and failover tolerant. But assuming that you have installed the WordPress website only on one LAMP server (Linux, Apache, MySQL and PHP). So that in case this primary website goes down then you can run the secondary from an external domain.)
      • That you already installed and configured ‘WordPress’ on the server.
      • That this site is configured behind an ELB (Elastic Load Balancer).
      • That your primary website is running on EC2 instance and failover secondary website (“”) is running on WordPress domain.
      • That you have registered a domain name ( say at any domain registrar. I did at
    • So now let’s take the things forward from here.
      • First you will have to create a hosted zone exactly matching your registered domain name “” for your primary website in Route 53.
      • As you create a hosted zone in Route 53, it creates a couple of NS(Name Server) records. A SOA(Start of Authority) record. You will have to add a ‘A’ record for your EC2 website configured behind the ELB and another ‘A’ record for a S3 bucket (exactly matching the name of the registered website and configured as a static website). We will use this bucket for redirection.
      • See snapshot:
      • AWS Hosted ZOne futureCloud for EC2
      • AWS Hosted ZOne futureCloud for S3
  • Note down the 4 name servers and login to your registrars domain manager control panel(mine was and add those 4 entries as Name Server records.
  • See snapshot:
  • godaddy nameservers
  • Now are configured to run your primary website, go ahead and open a browser and run the website – “”.
  • See snapshot:
  • AWS S3 buckets
  • Now you have to configure the failover so that when the EC2 instance is not healthy or not running your secondary failover website should run.
  • To do that first you have to create another bucket (exactly matching the name of the external failover website “”.
  • See snapshot:
  • S3 Redirect from futureCloud S3 to wordpress S3
  • In the bucket “” configure it as a website with a redirection rule to redirect to the other bucket “”.
  • See snapshot
  • S3 Redirect from futureCloud S3 to
  • In the bucket “” configure it as a website with a redirection rule to redirect to the external website “”.
  • See snapshot:
  • AWS S3 buckets
  • In case of EC2 is not healthy or not running the request will first reach “” bucket but it will redirect to the other bucket which is configured to redirect it to your external site.
  • Go to the Route 53 to configure another “hosted zone” which exactly matched the name of the external domain name (“”) and add an ‘A’ record as failover to the bucket by the same name.
  • As EC2 instance is down, the Route 53 first looks for s3 bucket “” but sees a redirection rule for bucket “” and which in turn has a redirection to the actual external website “”. The hosted zone entry thus maps this failover and redirects you to the external website.
  • Now go to the bowser and run “”, but this time you will see that the website is redirected to “”
  • See snapshot:
  • external website running
  • All these redirection setting are being done because the AWS Route 53 is still not a very powerful DNS tool.

Thanks for reading this article. Please contact me in case you need any help. Please go to “About Us” page to view my details.

CloudWatch – a service to do EC2 Instance Health Check/Monitoring , Troubleshooting, Metrics and Analysis

The Health Check/Monitoring , Troubleshooting, Metrics and Analysis of the EC2 instances and getting timely alerts to fix the problems to keep your cloud architecture highly available, auto-scaling and fault tolerant are one of the important roles and responsibilities of a cloud architect or SysOps admin. Let’s check how we can achieve this.

So lets first try to understand what CloudWatch is – Its is a AWS’s health monitoring service to monitor the AWS resources and the applications. It can monitor the following:
– Compute resources like Auto scaling groups, Load balancers, Route 53,
– Storage resources like EBS volumes, storage gateways, Cloud Front,
– Database services like relational RDS instances, non-relational services                   like DynamoDB,
– Analytics services like Elastic Map Reduce, Red Shift,
– In-memory cache services like Elastic Cache to name a few.

The CloudWatch can monitor the following metric:
 – CPU Utilization
 – Disk Reads
 – Network In and Outs
 – Status checks
But it can’t check a few other metrics like Memory Utilization for that we have to add custom metrics, which we will see later in this post.

The default monitoring checks these metrics every 5 minutes whereas the detailed monitoring is every 1 minute.

The status checks listed above can be of two type:
 – System Status Checks – checks related to the host on which the instance                  is virtualized. E.g Loss of network or power,  software or hardware issues               on the host machine. Normally restarting/terminating the instance or                           contacting AWS are the options available.
 – Instance Status Checks – checks related to the VM(Virtual machine) itself.               E.g. memory leaks, corrupted file system, incompatible file system,                                  mis-configured network. Normally restarting/terminating the instance or               checking/trouble shooting your own application for bugs are the options.

On the AWS console go to the CloudWatch service :
 – Click “Create dashboard”
 – Add a widget to dashboard based on the metrics listed above
 – Save the dashboard.(See snapshot below)

Now what if we want to monitor a custom metrics(Memory Utilization) which is not monitored by default by CloudWatch. Well then we have to use some custom scripts for it. Lets see how it is done.

- Install the required packages:
 sudo yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https
- Download the CloudWatch Custom Monitoring Scripts:
 curl -O
- Unzip the scripts:
 cd aws-scripts-mon
- Execute the script(You will get a "Successfully reported metrics to CloudWatch. Reference Id: 84bf63d3-2841-11e7-a20f-7786b8297dbd
" message on success):
 ./ --mem-util --mem-used --mem-avail
- Add a crontab job for 5 minutes intervals:
 */5 * * * * ~/aws-scripts-mon/ --mem-util --disk-space-util --disk-path=/ --from-cron

Once you have run these scripts successfully, the custom metrics for memory utilization will also be available and you can add it as a widget. See below.

Very Intuitive and Easy going step by step AWS tutorial for Beginners

Please try this link –

I have tried a lot of sites like,, etc to name a few, but the best one is this one.

It is very intuitive and easy going step by step AWS tutorial for Beginners. In which it helps you to create a highly available, auto-scaling WordPress website using EC2 instances, MySQL database over a pair of public subnets hosting the instances, a pair of private subnets hosting the databases enforced with load balance and Route53 DNS Management. Further is also uses CloudFront as CDN for website media, Cloudwatch and SNS for Alerts, Failover management.

I have never seen all this much put into one tutorial. In fact this website is hosted using the same approach. If you are an AWS enthusiast, this website will give you the fire in you to start sailing on this AWS boat and charm to dive deeper to learn more and advanced topics and services in AWS.

Wish you guys best of luck.


Compare Sitecore Vs Solr Items

Have you ever faced any urgent Production issue where your deployment succeeded and site is working fine and then you come to know that the number of items in the Solr and Sitecore don’t match and you also want to see the delta of those differences. You can also use this information to setup a threshold to setup alerts if the mismatch of items surpasses a defined limit(I used Amazon’s SNS(Simple Notification Service) to notify via email and text to the Production SWAT team as soon as threshold passed the limit)

This Powershell script will be very handy for you. The base idea is that you get detaisl of items from your Sitecore master and web database and also Solr master and web databases. Once you have these JSONs in hand comparing those objects would not be that difficult. Just filter out the columns you need and you are good to go.

//First Get Items From Sitecore Master Database
$childsMaster = Get-ChildItem master:/sitecore/content/../Products -Language * -Version *
write-host “Count of items Product Catalog(Master): ” $childsMaster.length

//Then Get Items From Sitecore Web Database
$childsWeb = Get-ChildItem web:/sitecore/content/../Products -Language * -Version *
write-host “Count of items Product Catalog(Web): ” $childsWeb.length

//Then Get Items From Sitecore Solr Master
$items_catalog_index_master = wget “*&fq=_language%3Aen-CA&rows=9999&fl=marketsku_s&wt=json&indent=true&#8221; | ConvertFrom-Json
write-host “Count of items catalog_index_master: ” $items_catalog_index_master.response.numfound

//Then Get Items From Sitecore Solr Slave
$items_catalog_index_web = wget “*&fq=_language%3Aen-CA&rows=9999&fl=marketsku_s&wt=json&indent=true&#8221; | ConvertFrom-Json

write-host “Count of items catalog_index_web: ” $items_catalog_index_web.response.numfound

write-host “Compare Sitecore Master Vs Web Databases”

Compare-Object $childsMaster $childsWeb -PassThru
write-host “Compare Sitecore Solr catalog_index_master Vs catalog_index_web”

Compare-Object ($ ($

write-host “Compare Master Database Vs Solr catalog_index_web”
Compare-Object ($childsMaster.comparefieldname) ($ -PassThru