Clone wiki

sitecore-automation / sitecore-environment

This methods provides functionality to processing Sitecore configuration file. With version 8.2 Sitecore provides configuration enable/disable guide. This is Excel file that contains information what configuration files should be enabled or disabled on specified Sitecore servers in distributed environment. Typical use cases:

  • Enable or disable configuration files on Content Management (CM) Server
  • Enable or disable configuration files on Content Delivery (CD) Server
  • Configure search provider Solr or Lucene on CD or CM Server

More information about configuration enable/disable guide is available on Sitecore site - Link

This file was converted to CSV file to enable easy processing by PowerShell. Only column headers names were changed by remove spaces:

Excel Header Name CSV Header Name
Product Name ProductName
File Path FilePath
Config file name ConfigFileName
Type Type
Search Provider Used SearchProviderUsed
Content Delivery ContentDelivery
Content Management ContentManagement
Processing Processing
CM + Processing CMProcessing
Reporting Reporting

Step 3: Options -whatif and -backup are your friends

⚠ This module could rename a lot of configuration files so be careful

Option -backup will archive App_Config folder.


Step 4: Run command Set-SitecoreEnvironment


$webPath = "B:\Sitecore 8.2 rev. 160729\"
$csvPath = "B:\Sitecore 8.2 rev. 160729\Website\App_Config\Config Enable-Disable Sitecore_8.2-160906_RTM.csv"

Set-SitecoreEnvironment -WebPath $webPath -CsvPath $csvPath -Environment ContentDelivery -WhatIf -Verbose

Set-SitecoreEnvironment -WebPath $webPath -CsvPath $csvPath -Search Solr -Environment ContentDelivery -WhatIf -Verbose