As you probably know, Sitecore requires a license.xml to run and it is tied to the Sitecore web root’s data folder within a valide license on it, otherwise you won’t be able to run Sitecore at all!
However, specially when you are deploying a production environment and following the recommendations from Sitecore, which says:
“After you install Sitecore, you can increase the security if you place the following folders outside the /Website root folder: /data and /indexes”
Therefore, by doing the procedure above you might see yourself in scenario such the image below.
Unlike previous versions where dataFolder variable was on web.config, Sitecore 8.1 has moved it to App_Config\Sitecore.config instead. However, accordingly Sitecore recommendation [p. 13]
“You should use App_Config/Include files instead of directly modifying the web.config file”
And I would say, let’s assume the same rule applies to Sitecore.config as both files contains many instructions for Sitecore running configuration which can save you from headaches in the future by following recommendations.
So, based on that, why don’t we have a look on App_Config\Include?
Well, seems there’s a DataFolder.config.Example…. what would be its content?
Pretty similar what we usually see in web.config and in Sitecore.config on new versions, right? Also, as you can see inside the document, it tells us to
“rename this file so that it has a .config extension“
Okie Dokie!!!!
- Stay on Sitecore_Instance\App_Config\Include path and find DataFolder.config.example
- Select it, righ-click and choose rename
- Remove everything after .config and the file is now DataFolder.config
So far, nothing has changed as dataFolder variable still points to /data and Sitecore still cannot find the license.xml there
Alright ladies and gentleman, follow me and let’s go fix IT!
- Open Notepad and change to All Files (*.*) at the bottom right corner
- Navigate to Sitecore\Website\App_Config\Include, choose DataFolder.config.example and click Open
- Locate the old value /data
- Replace /data by the new path – C:\Inetpub\wwwroot\Sitecore\Data\
- Save the DataFolder.config to apply the modification
Once everything is in place and modified, let’s check how are things with our Sitecore website…
… fair enough, it worked!
Cool! Thanks for reading and I’ll see you on my next post!
Deixe um comentário