Problem: I have a DotNetNuke (DNN) development site that is a copy of a live site. It has like 5,000 pages in it. Over the last three months, a client has gone through and made major navigation changes to the site. I really don’t want to go through the site page by page and recreate all the navigation changes that were made, so I wrote this script. You should be able to basically copy over all the navigation changes in about 3 minutes with these simple steps. The one part I left out is creating new pages because, I only had to recreate 4 of them.
Step 0.
Back up your databases. ALWAYS do that first.
Step 1.
In development: execute this SQL statement:
SELECT ‘update tabs set tabOrder = ”’ + cast(TabOrder as varchar(50)) + ”’, tabName = ”’ + cast(replace(TabName,””,”””) as varchar(50)) + ”’, IsVisible = ”’ + cast(IsVisible as varchar(50)) + ”’, ParentId = ”’ + cast(ParentId as varchar(50)) + ”’, [Level] = ”’ + cast([Level] as varchar(50)) + ”’, Title = ”’ + cast(replace(Title,””,”””) as varchar(500)) + ”’, Description = ”’ + cast(replace(Description,””,”””) as varchar(500)) + ”’, KeyWords = ”’ + cast(replace(KeyWords,””,”””) as varchar(500)) + ”’, TabPath = ”’ + cast(TabPath as varchar(500)) + ”’ Where tabID = ”’ + cast(TabID as varchar(50)) + ”’;’ as expr1 FROM Tabs
ORDER BY TabID
NOTE: This will create a bunch of update statements for you.
Step 2: Copy the output.
Step 3: Open a new Query Window in SQL Server Management Studio (make sure the database selected is the production database)
Step 4: Paste the output into this window. (you may have to go through and delete any NULL lines)
Step 5: Tweak anything at this point. When you are ready, execute the statements. (FYI- they will all execute because of the ; at the end of each statement)
Step 6. Login to your DNN portal as host.
Step 7. Go to: HOST -> Host Settings and scroll to the bottom.
Step 8. Click restart system. Give it a minute or two, then look at the nav.
Here is the full blog post on how I did that:
http://thoughtsought.wordpress.com/20...