Disable a Module in Orchard SDF Database

Somedays ago I was dealing with an issue that caused my blog www.techrepository.in to go offline. I was playing around the SSL module in Orchard Dashboard and accidently saved it with some incorrect settings. It brought my entire site down and I was unable to login to the Dashboard too. One of the option I had was to download a backup, restore it in local and then upload it back to production which will subsequently override my incorrect setting. But I didn't want to go that way because it was time consuming and lot of work involved, so I decided to put it in the backburner for the time being and decided to consider it if nothing works out.

I googled a lot and finally stumbled on an article which explained the steps needed to disable a module using the database Orchard uses. Normally when we configure Orchard for the first time, we have the option to choose either SQL Server or SQL Server CE as the database. In my case I chose SQL CE database and now I needed to find a tool which can be used to connect and run queries against it. I found this wonderful utility called LinqPad for this and I have already published a detailed post on how to use it with a SQL CE database. 

First thing you needed to do is to stop the website in IIS and download the SDF file from your hosting space. For an Orchard CMS, the default location for the database will be Site Root -> App_Data -> Sites -> Default. The structure of these two tables are given below.

 

To disable a module, you will need to delete the entries for the module from the two tables

Settings_ShellFeatureRecord
Settings_ShellFeatureStateRecord

Once the entries are deleted, you can upload the SDF file back to your hosting space by replacing the existing one. Also you need to delete the cache.dat file in the App_Data folder before restarting the website in IIS. That's all you need to disable a module, now you will be able to access your site and can verify this by checking from your Orchard Dashboard.


No Comments

Add a Comment