Sitecore 9 uninstall, my take

I have installed Sitecore 9 on a machine, but I needed also to clean up at one point.

There are already a couple of articles/references about this subject:

But I’ve decided to use Rob’s uninstall scripts referenced here in his introductory article about SIF-less, but in case you want to do it in a manual way, I wrote some steps below.

But also this process requires some extra assistance/adjustments as I am having the necessary SQL server installed on a different machine.

Before running the scripts that was generated by SIF-less, make sure to install SQL Server PowerShell Module by opening PowerShell as administrator by running this command:

Install-Module -Name SqlServer -AllowClobber

For more information look at this page that has the official documentation for installing the SQL Server PowerShell module.

Then copy the remove json files from the folder Scripts that comes with the the SIF-less archive into the folder for your XP0 Configuration files, defined by $PSScriptRoot in the install script and then copy the Invoke psm1 files from the folder Scripts that comes with the the SIF-less archive into the folder that has your uninstall script.

Extra: if Sitecore 9 was installed using a different folder than the default one, using instructions from here, then the removal scripts remove-sitecore-XP0.json or remove-xconnect-xp0.json have to be modified too, in similar way.

Manual way to uninstall an instance of Siteocre 9 involves few steps, but it is not that bad. Assuming that your installation instance is prefixed with xp0Demo then:

  • Remove the two xConnect windows services (with sc.exe delete [servicename] in poweshell as administrator or in cmd.exe as administrator too)
    • xp0Demo.xconnect-MarketingAutomationService
    • xp0Demo.xconnect-IndexWorker
  • Remove the Sitecore and xConnect website and application pools from IIS
  • Remove the Sitecore and xConnect webroots
  • Remove the databases from SQL Server prefixed with xp0Demo
  • Stop the Sorl service and remove the indexes prefiex with xp0Demo from folder c:\solr\solr-6.6.2\server\solr\. Do not forget to start the Solr service again.
  • Hosts entries that are prefixed with xp0Demo should be removed too

Also I’ve tested the procedure on a Sitecore 9 update 1 and its exactly the same, not changes required.

Advertisements

Sitecore 9 update 1 installation with SQL Server on a different server

Sitecore 9 update 1 was just released. So it’s quite fresh from the oven.

I’ve just tried the installation on a web machine that uses SQL Server installed on a different server and made some discoveries related with prerequisites  needed for the installation.

So beside the standard prerequisites mentioned in the installation documentation (must log into https://dev.sitecore.net/ before downloading) there are couple requirements that have to be installed on your webserver:

    1. Microsoft SQL Server TransactSQLScriptDom – install both SqlDom.msi for x64 and x86 – install this before DacFx
    2. Microsoft Shared Management Objects for SQL Server 2016  – install both SharedManagementObjects.msi for x64 and x86
    3. Microsoft® SQL Server® 2016 Feature Pack
      1. Microsoft ODBC Drivers for Microsoft SQL Server – install both msodbcsql.msi for x64 and x86
      2. Microsoft Command Line Utilities 13 for SQL Server – install both MsSqlCmdLnUtils.msi for x64 and x86
    4. SQL Server PowerShell Module – by opening PowerShell as administrator and  run this command:
      Install-Module -Name SqlServer -AllowClobber
    5. Extra (so I find it later, even that is in the official documentation): Microsoft Visual C++ 2015 Redistributable – was introduced in this Sitecore 9 update 1 as its needed by ChilkatDotNet46.dll. Download from here.

I guess that’s all.

Happy installing and let me know if you need any assistance.

Sitecore 9 on Windows 8.1, my experience

There are a couple of articles about Sitecore 9 on a Windows 8.1 development machine, and since it’s bit out of hand for me to upgrade to Windows 10 I’ve decided to take the bull by the horns and finally do it. Even that I’ve lost a bet with @SitecoreClimber that will manage to install Sitecore 9 to my Windows 8.1 in fist-second week of the launch without any troubles.

Windows 8.1 does not have Powershell 5.1 as its needed by SIF, so you can install it from here, as Windows Management Framework 5.1 includes also Powershell 5.1. An alternative way it to use this command choco install powershell if you are using Chocolatey.

After a restart of the machine it’s time to install Sitecore Install Framework and Sitecore Fundamentals. So in a Windows Powershell opened as Administrator execute this:

Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
Install-Module SitecoreInstallFramework
Update-Module SitecoreInstallFramework

Run the following command in Windows Powershell to validate the modules installed:

Get-Module SitecoreInstallFramework –ListAvailable

After this you can continue with the installation of SOLR. The script that Jeremy Davis made in his blog post it’s not going to work as New-SelfSignedCertificate has different parameters in Windows 8.1, so you could use my adjusted script.

After Solr its installed and up and running make sure than all the other prerequisites are meet:

  1. Sitecore License must have xDB enabled
  2. MS SQL Server 2016 SP1 or later
  3. MS SQL Management Studio
  4. .Net Framework 4.6.2 or later
  5. Web Deploy 3.6
  6. Java Runtime Environment
  7. Packages for XP Single (On Premises deployment)
  8. Microsoft SQL Server Data-Tier Application Framework (DAC Fx) (install both DacFramework.msi for x64 and x86)
  9. Microsoft SQL Server TransactSQLScriptDom (install both SqlDom.msi for x64 and x86)
  10. Extra step (added by me): Microsoft Shared Management Objects for SQL Server 2016 (install both SharedManagementObjects.msi for x64 and x86) since I do not have on my dev machine MS SQL Server 2016 SP1 or later or MS SQL Management Studio

Then make sure that you follow the changes to the scripts that Fabian is presenting here.

In short the changes are:

  1. Create a self-signed certificate in Windows 8.1
  2. Change xconnect-createcert.json
  3. Change the official installation script

Extra notes:

Note 1:

  • Make sure that the script New-SignedCertificateWindows81.ps1 is located in same place as the installation script so that can be picked up
  • Make sure that JRE bin folder does exist in the PATH Environment Variable, otherwise New-SignedCertificateWindows81.ps1 will not work.

In case you already have a SSL certificate in your machine then the changes that Fabian is presenting are not needed as you should use this article for installing your solution Sitecore 9 installation with existing SSL that I’ve wrote last week.

Note 2: The steps #8, #9 and #10 from the prerequisites should be installed in all situations when you install Sitecore 9 and you do not have on your web server MS SQL Server 2016 SP1 or later or MS SQL Management Studio

Note 3: On my way to install Sitecore 9 when I’ve installed only x64 version of add-ons from prerequisites ( steps #8, #9 and #10) and apparently was not enough as I was getting bunch of errors, so I had to install x86 versions too.

Sitecore 9 installation with existing SSL

You probably installed already Sitecore 9 on your environments following different blogs with necessary clarifications.

But, might happen that you already have a SSL certificate for your environments.

The affected places are:

  1. Installation of SolR
  2. Installation of Sitecore 9 itself

One of the places where SSL it’s needed its on the SolR instance. So by following the instructions from Jeremy Davis on this blog post I’ve adjusted his script in order to use an already existing certificate, where I’ve introduced a new variable

$solrNameSSL = "MySSLFriendlyName"

And then used this new variable $solrNameSSL in all places that have references to SSL instead of $solrName and adjusted the place where the code is searching for the certificate Cert:\Localmachine\My not only Cert:\Localmachine\Root.

The result script is here, but please do not forget to adjust necessary variables :

In the installation script of Sitecore 9 itself, some changes are required in order to use the already installed certificate.
One of the standard steps is to install a client certificate for xconnect, and that one has to be removed or at least commented out. This step usually looks like this:

#install client certificate for xconnect 
$certParams = @{     
	Path = "$PSScriptRoot\xconnect-createcert.json"     
	CertificateName = "$prefix.xconnect_client" 
} 
Install-SitecoreConfiguration @certParams -Verbose 

I recommend to comment out only this line
Install-SitecoreConfiguration @certParams -Verbose
and in the  variable CertificateName that is defined above to put your certificate friendly name or the certificate thumbprint.

This will cover the client authentication certificate and next will be to make necessary changes for the server authentication certificate. The parameter that is called SSLCert has to be added in script part that deploys the xconnect instance, as follows:

#deploy xconnect instance
$xconnectParams = @{
 Path = "$PSScriptRoot\xconnect-xp0.json"
 Package = "$PSScriptRoot\Sitecore 9.0.0 rev. 171002
(OnPrem)_xp0xconnect.scwdp.zip"
 LicenseFile = "$PSScriptRoot\license.xml"
 Sitename = $XConnectCollectionService
 XConnectCert = $certParams.CertificateName
 SSLCert = $certParams.CertificateName
 SqlDbPrefix = $prefix
 SqlServer = $SqlServer
 SqlAdminUser = $SqlAdminUser
 SqlAdminPassword = $SqlAdminPassword
 SolrCorePrefix = $prefix
 SolrURL = $SolrUrl
}
Install-SitecoreConfiguration @xconnectParams

That is needed because if is not provided a certificate will be generated automatically to be used use for the HTTPS web bindings of the xconnect website.

In the Oficial Installation guide in chapter 4.1 and chapter 8.1.1 there is more information about SSL requirements and where and how it’s used.

 

grunt build with compass fails on some environments, my approach to fix it

As I have mentioned in my first post here, I will write also about other things not only Sitecore, as in my daily work I do work with other things too.

So, let’s get into it.

Sometimes I need to build in my local environment the frontend project that my colleagues create in order to make small changes/adjustments or test the backend work much better.

And one some project, true, some old ones I was getting this error when building with grunt the project :

Warning: Running "compass:dist" (compass) task
Warning: not found: compass Use --force to continue.

I have tried many things on my environment to fix this and seems that a combination of things let to fix this problem, so now I can build old frontend projects:

  1. Un-install all versions of Ruby from the working computer
  2. Install latest version of Ruby into the Windows machine with the option “Add Ruby executable to your PATH” selected and then restart the computer
  3. Install Compass and Sass on your computer. Open command prompt and run the following commands:
      1. gem update --system
        gem install compass
        gem install sass
        
  4. Update compass in your project with this command from inside your project dir
      1. npm install grunt-contrib-compass --save-dev

I hope it works for you.

Good luck.

Sitecore SignalR, my changes

On a existing project I had to use SignalR for a page to facilitate real-time update of the information for all the visitors/users that were interacting with that page.

Indeed I turned to Sitecore SignalR module and used as resources other blogs/websites that wrote about the subject:

Everything looked great, I’ve build my page with my entire functionality, getting to the point where I needed the username of the visitor of my page/site. Since my website is protected with ADFS Authentication, I had to protect the SignalR hub and to pass authentication information to clients. Then I’ve used this, from the official documentation, and I’ve changed the code from InitializeSignalR.cs where before the line

args.App.MapSignalR(Settings.SignalR.Path, new HubConfiguration());

I’ve added

GlobalHost.HubPipeline.RequireAuthentication();

And as for the username, I’ve save it into a cookie on the page load of the component that has the SignalR functionality, and then I’m using it into the JS functionality of my SignalR functionality.

Then, since our implementation will be residing on couple of servers that were behind a LoadBalancer, and it was needed that the messages distributed by SignalR to get to all clients so SignalR Scaleout with SQL Server was needed. I’ve used the documentation from here, as follows:

  1. Created a new empty database. The backplane will create the necessary tables in this database.
  2. Added an extra NuGet package to your application:
  3. Added the following code to InitializeSignalR.cs to configure the backplane:
    • var connection = System.Configuration.ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString;
      GlobalHost.DependencyResolver.UseSqlServer(connection);
      

       

  4. Then Enable Service Broker and give proper permisions to the database for the user used in the connection string as it explains further in the documentation.

I’ve added the entire file InitializeSignalR.cs into a Gist

Recompile your code, and you should be all set.

Sitecore 8 fixes from Sitecore Support

This year I have worked quite a lot with Sitecore 8 Update 1 and I have ended up in some situations that I had to write to Sitecore Support in order get help, but in most cases there was just fixes that they had to provide.

I will provide here a list with the fixes that I’ve received, and a small description, but please talk with Sitecore Support in order received the full fix from them. I will write the list here in no particular order.

  1. Insert page does not create item successfully while Enforce Version Presence feature is enabled at its template. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.105682. And here you can read more about Enforce Version Presence.
  2. Desktop link to Experience Editor always switches site to Preview.DefaultSite. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.119280.
  3. Enforce Version Presence breaks languages switching in the Experience Editor. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.151776-8.2.0.0.
  4. MediaDialog does not show content of “All image files” for non-admin users in Experience Editor. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.158291.
  5. Simulated device and page does not appear until change in zoom. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.51575.
  6. Fix the preview date issue in Experience Editor in a multiple site configuration. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.82260.
  7. Incorrect caption of languages with neutral culture in the “Languages” chunk in the ribbon. The fix is provided by asking Sitecore Support for this fix Sitecore.Support.162413-8.2.1.0.

If you encounter similar problems as mentioned above please talk with Sitecore Support, as I have noticed that those fixes might have not been introduced into new updates from Sitecore 8 or even Sitecore 9

That is all for now, if I will encounter more fixes I will update this post.