Setup Sitecore Habitat with Sitecore 9.0 Update 2 in 30 Minutes!- Part 1

Sivalingaamorthy Subramaniam
6 min readSep 13, 2018

--

Habitat Home Page!

Are you Sitecore developer and want to install the Sitecore Habitat ? This article will help you install the Sitecore Habitat in less than 30 minutes MAX !

In Sitecore 8.2 update 1 (Habitat Release 1.4), Habitat installation was so simple, you just need to upload the Sitecore package. But Habitat release 1.5 onward, it is little complicated for beginners. I expect this article will help some beginners out there!

Do you want to learn about Habitat in simple and practical way, look at the below article !

You will see serious of blog post (links below) on Habitat project, explains how to setup end to end Azure DevOps Pipeline setup.

Part 1: Setup Sitecore Habitat with Sitecore 9.0 Update 2 in 30 Minutes!

Part 2: Setup ‘Sitecore Habitat’ to ‘Azure DevOps’ repository!

Part 3: Setup ‘Azure DevOps’ CI build for Sitecore Habitat

Part 4: Setup ‘Sitecore PaaS’ from Azure Marketplace!

Part 5: Setup ‘Azure DevOps’ CD/Release build for Sitecore Habitat

  1. Download the Habitat from the Release :

It is highly recommended to download the release version from GitHub because, the work-in-progress version may have partially completed functionality.

2. Save the Downloaded file into the local system and extract it.

Extracted Habitat

3. Install Vanilla Sitecore Instance with Sitecore XP Single (XP0) Instance, using the Powershell script, that is part of Habitat Project.

Powershell Script to install the Sitecore Instance

It is better to keep the Habitat download in simple folder structure like D:\Habitat\, if you keep the folder structure similar to the image you need to update the Rainbow.config settings “Rainbow.SFS.SerializationFolderPathMaxLength” value to 150 or more.

a. Ensure the solr is configured before installing the Habitat, if any help needed refer this link.

b. Open the Settings.ps1 update the highlighted values with appropriate details and save.

It is recommended to setup the website root in other than c:\ drive

c. Copy the following files to the ‘build\assets’ folder, from appropriate location. The assets folder should have the below listed files.

  • license file
  • Sitecore 9.0.2 rev. 180604 (OnPrem)_single.scwdp.zip
  • Sitecore 9.0.2 rev. 180604 (OnPrem)_xp0xconnect.scwdp.zip
  • sitecore-solr.json
  • sitecore-XP0.json
  • xconnect-createcert.json
  • xconnect-solr.json
  • xconnect-xp0.json

d. If you are not finding the .json files required, you can refer to the blow article.

d. Run ‘install-xp0.ps1’ in PowerShell command prompt (administrator mode).

e. Ensure the Sitecore Instance ‘habitat.dev.local’ setup is successful.

4. Check you are able to open ‘habitat.dev.local’ in browser and you are able to see the ‘Vanilla’ Site.

5. Open the Habitat.sln solution in Visual Studio

6. Compile and ensure the solution is building.

7. Check if the ‘Task Runner Explorer’, shows the Gulpfile.js taks!

If task runner explorer is not showing up, then open the window using menu (View -> Other Windows -> Task Runner Explorer)

8. If you see ‘No tasks found’, go to command prompt and run ‘npm install

9. Install the gulp globally, using ‘npm install -g gulp'

10. Click ‘Refresh’ in the Task Runner Explorer, you will see all the tasks listed.

11. Update the ‘gulp-config.js’ with appropriate instanceRoot path

Update InstanceRoot Path

12. Update the Habitat.Dev.Config file, SourceFolder path to current project folder , SourceFolder will be used as reference in Unicorn, to sync the contents (.yml).

13. Go to Task Runner Explorer and Run the ‘Default’ Task

14. Check if you encounter any error like ‘MSBUILD : error MSB1001: Unknown switch. Switch: /restore’,

15. Open the ‘gulpfile.js’ and comment the customArgs: [ “/restore” ] and save the file.

16. Repeat the Step 13 again

17. On Successful Completion of the gulp ‘default’ task execution, you will the success message like below

18. Now browse the ‘habitat.dev.local’ in the browser.

Habitat Home Page!

Alternatively

You can use Command Prompt or PowerShell Window to execute the gulp task.

1. Alternatively you can run the gulp from the PowerShell window, by giving ‘Gulp’, it will run the default task.

2. If you encounter any error like below ‘Security warning’, this could be because the gulp is not installed globally.

3. Ensure you have executed Step 9, to resolve this issue.

4. Repeat the Step 12, to run the gulp task again

Errors

  1. Do you see error like below

ERROR: The physical root path of this SFS tree, D:\Download\Sitecore\Habitat-1.6\Habitat-1.6\src\Foundation\Serialization\serialization\PlaceholderSettings.Feature, is longer than the configured max base path length 110. If the tree contains any loopback paths, unexpected behavior may occur. You should increase the Rainbow.SFS.SerializationFolderPathMaxLength setting in Rainbow.config to greater than 115 and perform a reserialization from a master content database. (System.InvalidOperationException)<div class="stacktrace">at Rainbow.Storage.SerializationFileSystemTree.get_MaxRelativePathLength()

Solution

Update the Rainbow.config settings ‘Rainbow.SFS.SerializationFolderPathMaxLength’ value to 150, the default value is ‘110’

Happy Coding!

--

--

Sivalingaamorthy Subramaniam
Sivalingaamorthy Subramaniam

Written by Sivalingaamorthy Subramaniam

Techie by profession, having decade and half, years of experience. Nature lover, interested in travel, hiking!

Responses (2)