December 21, 2024

As Sitecore with Containers is new, we wanted to try some hands on and do some POC before actually implementing it with AKS and Containers.

Challenge:

We added a new Publishing Target to the local environment, mainly for Preview purpose before it is pushed to Live. As soon as the <database> config node was added, Sitecore started getting crashed and kept on getting restarted. And when we removed the database node, Sitecore was working well.

Here is the database config patch file that we had added for preview:

<?xml version="1.0"?>

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
	  <databases>
		  <database id="preview" patch:after="database[@id='web']" singleInstance="true" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel">
			  <param desc="name">$(id)</param>
			  <icon>Images/database_web.png</icon>
			  <securityEnabled>true</securityEnabled>
			  <dataProviders hint="list:AddDataProvider">
				  <dataProvider ref="dataProviders/main" param1="$(id)">
					  <disableGroup>publishing</disableGroup>
					  <prefetch hint="raw:AddPrefetch">
						  <sc.include file="/App_Config/Prefetch/Common.config" />
						  <sc.include file="/App_Config/Prefetch/Webdb.config" />
					  </prefetch>
				  </dataProvider>
			  </dataProviders>
			  <proxiesEnabled>false</proxiesEnabled>
			  <proxyDataProvider ref="proxyDataProviders/main" param1="$(id)" />
			  <archives hint="raw:AddArchive">
				  <archive name="archive" />
				  <archive name="recyclebin" />
			  </archives>
			  <cacheSizes hint="setting">
				  <data>100MB</data>
				  <items>50MB</items>
				  <paths>2500KB</paths>
				  <itempaths>50MB</itempaths>
				  <standardValues>2500KB</standardValues>
			  </cacheSizes>
		  </database>
	  </databases>
  </sitecore>
</configuration>

Solution:

We achieved this by creating a .dat file – inside the App_Data/items folder. This is basically similar to creating Item Resource Files.

What we did – is we created a folder inside the App_Data/items folder with the same name as that of the database – as in our case – “preview” and inside it we created a file items.webcluster2.dat – which was a copy of items.web.dat file.

Again, we did this with Sitecore 10.1 and this approach is not officially supported by Sitecore but we made it working for our case.

Also, we found a couple of references which helped us gain more confidence on what we had done and also showed some direction

Special thanks to my friend and colleague Jatin Prajapati who helped in troubleshooting and we found this solution together.

References:

https://sitecore.stackexchange.com/questions/29001/why-does-my-asset-image-have-dat-files-instead-of-dacpac-files

Happy Sitecoring and Happy Dockering! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *