Tagged Posts

Welcome back to the DotNetNuke tips! I started doing this over a year ago, though with getting married last fall and working on my Datsun 240Z lately I haven't blogged near as much lately about DNN topics. So here we go, starting up again with my DotNetNuke Tips. Today's tip follows: When you're doing testing locally with a backup for a Production Database and Website one of the things you need to be sure to do is change your Portal Alias for your local URL, instead of your production URL. If you don't do this you'll hit the local URL and it will most likely redirect you to the production URL. This can cause a bit of chaos if you don't notice that you're no longer on the local/testing URL and start modifying the production web site. To change your portal alias you can do the following. Open your SQL Server management tool; SQL Enterprise Manager, SQL Server Management Studio, or whatever you choose to use. Browse to your local/test database, open up the PortalAlias table. You can either Modify your existing Alias, or you can add a new Alias to this table. test.myurl.com for example, be sure to setup the proper portal ID if you're adding a new alias and you have a lot of different aliases in there. You might also need to setup the aliases for the child portals as well if you plan on using those. The next step is crucial. You'll want to reset your website before you try to hit the new alias. You can do that in a couple of ways, I always prefer to open up the web.config file, add a carriage return and hit save. This will cause IIS to reload the site, clearing out the cache and loading the new portal aliases. Look for more DotNetNuke tips coming soon!Posted from...
I decided to remove some unused blogs and photo galleries from a few of my CommunityServer sites today. Here's some ROUGH SQL code to do it.It worked for me, but I make no guarantees how it will work for you! Backup your database before performing any type of maintenance.Be sure to sub in your UserId where I note below with the ##. I run the commented out code first at the top, this creates a quick table, after doing my testing I commit the changes then drop the table I had created.I don't claim this code is great, but it got the job done :D/*create table temp_deletesections(SectionId int,Processed int default 0)*/begin tran tran--rollbackdeclare @rowsAdded intinsert into temp_deletesections @rowsAdded intinsert into temp_deletesections into temp_deletesectionsselect sectionid, 0 from cs_sections sectionid, 0 from cs_sectionswhere totalposts <1 totalposts <1set @rowsAdded = @@rowcount @rowsAdded = @@rowcountwhile @rowsAdded > 0begindeclare @sectionDeleteId intselect top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0 @rowsAdded > 0begindeclare @sectionDeleteId intselect top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0begindeclare @sectionDeleteId intselect top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0 @sectionDeleteId intselect top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0 top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0exec dbo.cs_Section_CreateUpdateDelete @SectionID=@sectionDeleteId,@DeleteForum=1,@SettingsID=1000,@UserID=## dbo.cs_Section_CreateUpdateDelete @SectionID=@sectionDeleteId,@DeleteForum=1,@SettingsID=1000,@UserID=##update temp_deletesections set Processed = 1 where Processed = 0 and sectionId = @sectionDeleteId temp_deletesections set Processed = 1 where Processed = 0 and sectionId = @sectionDeleteIdset @rowsAdded = @rowsAdded-1 @rowsAdded = @rowsAdded-1end--commit--drop table temp_deletesections  Posted from...
RSS URL

Chris Hammond

Chris Hammond

is a father, husband, leader, developer, photographer and car guy. Chris has long specialized in ASP.NET and DotNetNuke (DNN) development, so you will find a variety of posts relating to those topics. For more information check out the about Chris Hammond page.

If you are looking for DotNetNuke consulting please visit Christoc.com Software Solutions

Find me on Twitter, GitHub and LinkedIn.