Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Tidy up database tablesTidy up database tables
Previous
 
Next
New Post
1/27/2015 4:49 AM
 

I've inherited the maintenance of a DotNetNuke (v6.2.0.1610) site, and one of the things I'd like to do is to tidy up the database tables being used.

It looks like there might have been two installations of DNN into the same database (I'm guessing, I don't know its history and cannot find out), I'm making this assumption because there are two sets of DotNetNuke tables.

For example, we have:
dbo.Portalsdbo.PortalSettingsdbo.Profiledbo.Roles, etc.

However, then we also have the same set, prefixed with dnn_ -
dbo.dnn_Portalsdbo.dnn_PortalSettingsdbo.dnn_Profiledbo.dnn_Roles, etc.

I spent a good while tearing my hair out when I could not get our portal to load, when I discovered it is because I was editing the dbo.PortalAlias table and I needed to be editing the dbo.dnn_PortalAlias table instead.

I wanted to avoid this future maintenance headache, so I backed up the database, and set about deleting all the tables without the dnn_ prefix (web.config specifies objectQualifier="dnn_"). I diligently ensured there was a matching dnn_ table before deleting any.

At first it seemed fine - the portal loaded and all the content was there, I thought I was on to a winner. However when I logged in and accessed the site admin section, that's when I started to get lots of error messages. So I figured I'd deleted too much, I restored the backup, and all is well - portal working again.

However, I really would like to get rid of the unnecessary tables, because no doubt at some point in the future I'll start doing some work on the database, forget about the dnn_ prefix and waste a bunch of time wondering why something isn't working.

So, as a bit of a DotNetNuke newbie, I'm after some help - how can I know what tables are in use, what aren't, and how can I set about tidying up the SQL Server tables? Thanks.

 

Cross-posted at StackOverflow: http://stackoverflow.com/questions/28166935/tidy-up-dotnetnuke-database-tables

 
New Post
1/27/2015 11:10 AM
 
please check the sqlserver section near the end of your web.config file. If there is an objectQualifier specifed to be "dnn" or "dnn_", all tables, views, functions and procedures with this prefix are the currently used ones, otherwise, if it specified as empty string, the on-prefixed objexts are currently being used.

You should be save to delete the unused set, but always need to keep "aspnet_" prefixed objects, which are used for membership management.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
1/27/2015 11:12 AM
 

Thanks, it turned out that there was a view, dnn_Lists, which was still referencing dbo.Lists as opposed to dbo.dnn_Lists. I corrected the view, and it is all fine.

 
New Post
1/27/2015 11:18 AM
 
That sounds like an old bug (missing variable in SQL script), which should be fixed in latest version.
I suggest upgrading your site at least to DNN 6.2.9, which should be easy - better would be latest version (7.3.4 atm), but there are major changes, which require addition testing and evetually skin modifications.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Tidy up database tablesTidy up database tables


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out