DotNetNuke, ASP.NET, Web Development Blog

DotNetNuke: Which modules are being used (and which aren't)

Sometimes, you need (or want) to know which of the modules that are installed on your DNN site are being used, which aren't, and where a module is being used. This can be useful if you want to uninstall unused modules for performance improvements or if you're planning on upgrading your site and you need to know what modules you'll need to test or upgrade. Here's some sql that will help you answer these questions...

 

Note: If you know the Host login for your site, you can run these sql statements in your Host-> SQL tab.

Question 1: What modules are being used in my DNN instance (excludes admin modules)?

Select Distinct dm.ModuleName from Modules m
    INNER JOIN ModuleDefinitions md on m.ModuleDefID = md.ModuleDefID
    INNER JOIN DesktopModules dm on md.DesktopModuleID = dm.DesktopModuleID
    WHERE dm.IsAdmin = 0

Question 2: What modules are installed but not being used?

Select ModuleName from DesktopModules where isadmin = 0 AND
    ModuleName not in (select Distinct dm.ModuleName  from Modules m
    INNER JOIN ModuleDefinitions md on m.ModuleDefID = md.ModuleDefID
    INNER JOIN DesktopModules dm on md.DesktopModuleID = dm.DesktopModuleID)

Question3: Where is a particular module being used?

Note: You'll need to replace the Module Name at the very end of this statement with the Module Name of the one you are looking for.

Select tm.TabID, t.TabName, pl.PortalName
    FROM DesktopModules dm 
    INNER JOIN ModuleDefinitions md on dm.DesktopModuleID = md.DesktopModuleID 
    INNER JOIN Modules m ON md.ModuleDefID = m.ModuleDefID
    INNER JOIN TabModules tm ON m.ModuleID = tm.ModuleID
    INNER JOIN Portals p ON m.PortalID = p.PortalID
    INNER JOIN Tabs t ON tm.TabID = t.TabID
    INNER JOIN PortalLocalization pl ON p.PortalID = pl.PortalID
    WHERE dm.ModuleName= 'Articles'

 

Comments

Leave a Comment
Gravatar
Name:
Email: (not displayed)
Comments:

CAPTCHA image
Enter the code shown above:
Website

Return to previous page
  Search Articles...