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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumMerge Data from ForumsMerge Data from Forums
Previous
 
Next
New Post
5/17/2011 5:29 PM
 
Greetings,

Currently, we have data that resides in 10 differetn forums discussion groups. I need to merge the data in these groups to new discussion groups by merging 2 or 3 of the groups into one. These groups are used to manage police dept beat data. We are converting to zones and need to merge the groups together.

What would be the best method to accomplish this?

Todd

 
New Post
5/17/2011 5:31 PM
 
I imagine you would likely be best served to go through and change the forumid associated with each of the threads? You would probably have to do this in the database though, unless you wanted to use the MOVE feature in the forum, though I don't think you can do a mass move, so you would have to go through each thread individually (painful)

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/17/2011 7:05 PM
 
Thanks Chris for your feedback. I thought this is what I may have to do but wanted to get some feedback and evaluate the alternatives.

Chris P what do you think?

Todd
 
New Post
5/17/2011 7:42 PM
 
Chris P is at TechEd this week, he may be slow in responding

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/19/2011 2:42 AM
 
Here is a script we had lying around that we have used in the past. I have not checked this recently but I believe it should handle everything you need. One important note about this is it basically is doing what Chris H recommended but in addition to that the forum thread/post counts are being updated. 

DECLARE @FROMForumID integer
DECLARE @TOForumID integer
DECLARE @ForumGroupID integer
DECLARE @FROMForumName nvarchar(200)
DECLARE @TOForumName nvarchar(200)
DECLARE @Threads integer
DECLARE @Posts integer


SET @ForumGroupID = 1 -- Your Forum's Group ID
SET @FROMForumID = 1 -- Forum to Eliminate
SET @TOForumID = 2 -- Forum to Consolidate to


SET XACT_ABORT ON
SET ARITHABORT ON
SET NOCOUNT ON


-- Get FROM Forum Information
SELECT @FromForumName = [Name] FROM Forum_Forums WHERE ForumID = @FROMForumID
SELECT @ToForumName = [Name] FROM Forum_Forums WHERE ForumID = @TOForumID



-- If no forum is found, erroneous data was supplied
IF (@FromForumName) IS NULL
BEGIN
PRINT 'Forum Id [' + CAST(@FROMForumID AS varchar(10)) + '] was not found.'
GOTO Skip
END
IF (@TOForumName) IS NULL
BEGIN
PRINT 'Forum Id [' + CAST(@FROMForumID AS varchar(10)) + '] was not found.'
GOTO Skip
END
PRINT 'Moving FROM: [' + (@FROMForumName) + '].'
PRINT 'Moving TO  : [' + (@TOForumName) + '].'


SELECT @Threads = TotalThreads, @Posts = TotalPosts
FROM forum_forums
WHERE ForumID = @FROMForumID
PRINT 'Current FROM Counts [Threads/Posts]  : [' + CAST(@Threads AS varchar(5)) + ' / ' + CAST(@Posts AS varchar(5)) + '].'


SELECT @Threads = TotalThreads, @Posts = TotalPosts
FROM forum_forums
WHERE ForumID = @TOForumID
PRINT 'Current TO   Counts [Threads/Posts]  : [' + CAST(@Threads AS varchar(5)) + ' / ' + CAST(@Posts AS varchar(5)) + '].'


SELECT @Threads = Count(*) FROM forum_threads WHERE ForumID = @TOForumID
SELECT @Posts = Count(*) FROM forum_posts WHERE ThreadID IN (SELECT ThreadID from forum_threads where ForumID = @TOForumID) AND IsApproved=1
PRINT 'Actual Counts [Threads/Posts]   : [' + CAST(@Threads AS varchar(5)) + ' / ' + CAST(@Posts AS varchar(5)) + '].'


BEGIN TRAN


UPDATE forum_threads
SET ForumID = @TOForumID
WHERE ForumID = @FROMForumID


SELECT @Threads = Count(*) FROM forum_threads WHERE ForumID = @TOForumID
SELECT @Posts = Count(*) FROM forum_posts WHERE ThreadID IN (SELECT ThreadID from forum_threads where ForumID = @TOForumID) AND IsApproved=1
PRINT 'New Counts [Threads/Posts]   : [' + CAST(@Threads AS varchar(5)) + ' / ' + CAST(@Posts AS varchar(5)) + '].'


UPDATE forum_forums
SET TotalPosts = @Posts, TotalThreads = @Threads, GroupId = @ForumGroupId
WHERE forumid = @TOForumID


UPDATE forum_forums
SET TotalPosts = 0, TotalThreads = 0, IsActive = 0
WHERE ForumId = @FROMForumID


COMMIT TRAN

Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumMerge Data from ForumsMerge Data from Forums


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