Have no idea on how to find pages containing a DNN module using a SQL script?
Before any DNN module upgrade, we have to find out the pages that use the module.
This helps to ensure that website pages do not break due to incompatible module upgrades.
At Bobcares, we often receive requests regarding the DNN website as part of our Server Management Services.
Today, let’s discuss how our Support Engineers do it easily for our customers.
What is DNN?
DNN is an open-source web content management software based on Microsoft .Net technology.
It provides the capability for multiple users with different permission levels to manage a website or a section of the content.
Website owners mainly use this DNN application due to the portal based architecture. This allows running many sites on just one DNN installation.
In DNN we can add modules on the pages to add extra features on the pages. But in some cases, we face some difficulty to find in which pages a specified module is using. Let’s see how our Support Engineers find it easily.
SQL script to find pages containing a DNN module
In some DNN versions, we are not able to see in which pages a specific module is present. Recently, we helped one of our customers to find out the pages which use the DNNForge module.
Let’s see how our Support Engineers help the customer to find it.
1. Initially we log in to Microsoft SQL Server Management Studio.
2. Then right-click on the respective database.
3. Then we select the New Query option.
4. After that, we paste the following Script in the New Query page.
declare @moduleName nvarchar(255) = ‘%DNNForge%’
;with DM as (select * from dbo.DesktopModules where friendlyname like @DNNForge),
md as (select * from dbo.moduledefinitions where desktopmoduleid in (select desktopmoduleid from dm)),
m as (select * from dbo.modules where moduledefid in (select moduledefid from md))
,tm as (select * From dbo.tabmodules where moduleid in (select moduleid from m))
,t as (select * from dbo.tabs where tabid in (select tabid from tm))
declare @moduleName nvarchar(255) = ‘%DNNForge%’
;with DM as (select * from dbo.DesktopModules where friendlyname like @DNNForge),
md as (select * from dbo.moduledefinitions where desktopmoduleid in (select desktopmoduleid from dm)),
m as (select * from dbo.modules where moduledefid in (select moduledefid from md))
,tm as (select * From dbo.tabmodules where moduleid in (select moduleid from m))
, t as (select * from dbo.tabs where tabid in (select tabid from tm))
select TabId,t.PortalId,TabName,p.PortalName From t join dbo.portallocalization p on t.portalid=p.portalid
select TabId,t.PortalId,TabName,p.PortalName From t join dbo.portallocalization p on t.portalid=p.portalid
After running this script it will return the TabID, PortalID, the Tab Name and Portal Name for the pages that are using the DNNForge module. We can easily find the pages of any DNN modules by changing the module name.
[Need assistance to find the pages containing the DNN module? We’ll help you.]
Conclusion
In short, by using the SQL script we can easily find out all the pages that use a particular DNN module. Also, we saw how our Support Engineers do this as part of our seamless DNN upgrades.
0 Comments