EPiServer 7.5

Alice in Wonderland and EPiServer Upgrade-EPiRemapDDSTypes

UPDATE: Paul Smith has created a DDS Remap Type Admin Plug-in (Download).

Just wanted to share this with you all and store this to myself.

Ever needed to remap DDS types? Not having the DDS type decorated with attributes?

You might find a few blog posts about using Upgrade-EPiRemapDDSTypes cmdlet but there isn’t the information how and where to run it. Well I faced the problem that a DDS stored type had been changed and found the references to Upgrade-EPiRemapDDSTypes cmdlet. All posts mentioned that you run it from PowerShell (well naturally)…

I was working on Windows Server 2012 R2 and launched the default PowerShell. I already had found the information that the PS Snapin containing the cmdlet is in EPiServer.Framework.Install.[EPiServer framework version here] so I tried to add the snapin in PowerShell but was greeted with a nice error message saying something like that the snapin is not found (or something like that). Then I remembered that ages ago I already had this similiar issue with EPiServer cmdlet and I remembered that one needs to use the 32-bit PowerShell!

So, to get started, launch the Windows PowerShell (x86). Add the cmdlet with the following command in the shell:

Add-PSSnapin EPiServer.Framework.Install.7.5.394.2

(the version number is the version you are using, for example in my environment: C:\Program Files (x86)\EPiServer\Framework\7.5.394.2\ at least I’m assuming it goes like this)
(2nd assumption is that you have installed EPiServer on the environment and not just using XCOPY deployment)

Then I executed the Upgrade-EPiRemapDDSTypes command and it asked for input parameters
Type
Connection string
DdsProviderName
DbProviderName
BinPath

Type – this was easy, the full type of the type we were storing to DDS
Connection string – easy, the connection string from the web app (EPiServerDB)
DdsProviderName – couldn’t find this one so used ILSpy on EPiServer assemblies and finally found this “EPiServerSQLServerDataStoreProvider” from EPiServer.Data.Configuration.DataStoreElement class (DefaultProvider property default value from the configuration attribute property OR InitializeWithDefaults method of the class)
DbProviderName – System.Data.SqlClient (just assumed this one to be based on the connection string config element, seems to work)
BinPath – path to the web application bin folder (like : f:\Sites\SomeSite\wwwroot\bin)

The above command didn’t cause any errors to the console BUT it didn’t seem to fix my case! Still our scheduled job failed with the same message to remap the type. I got frustrated and had already noticed that there is cmdlet called Upgrade-EPiDeleteDDSStore and that was my next choice, because this was a test environment without too much test content and most importantly because our job anyways always deletes all entries from this store and adds new refreshed data.

Upgrade-EPiDeleteDDSStore

One new input parameter StoreName. You can look this up from the tblBigTableStoreConfig table from the site database if you don’t remember it out of your head 😉

Finally I got my happy ending 😀

(Afterwards I think I maybe should have recycled the web application pool after running the Upgrade-EPiRemapDDSTypes and then run the scheduled job normally but I already was too frustrated with the issue so maybe I wasn’t thinking clearly back then and schedule job would have worked just fine after the recycle of application pool – leave a comment if you know or can test it :D)