Since I've had a little more time to play around with our servers I've started working to convert our Community Server forum tables to DNN forums and was curious if anyone else has gone thru this process.
I've successfully copied the data from the CS Sections Table to the DNN Forums_Forums table and reproduced all the basic forum sections / post data. I've been working on converting the threads / posts and that's been a little more problematic. As far as I can tell all the data is in the appropriate tables but no data is presented in the forum module.
Here are the SQL queries I've been playing around with to copy the data from point at to point b:
-- Building forum sections
SET IDENTITY_INSERT [DNNPE_DEV].[dbo].[Forum_Forums] ON
INSERT [DNNPE_DEV].[dbo].[Forum_Forums] (
ForumID,
Groupid,
IsActive,
ParentID,
Name,
Description,
CreatedByUser,
UpdatedByUser,
UpdatedDate,
TotalPosts,
TotalThreads)
SELECT
[CSDATABASE].[dbo].[cs_Sections].[SectionID],
1,
[CSDATABASE].[dbo].[cs_Sections].[IsActive],
[CSDATABASE].[dbo].[cs_Sections].ParentID,
[CSDATABASE].[dbo].[cs_Sections].Name,
[CSDATABASE].[dbo].[cs_Sections].Description,
1,
1,
CURRENT_TIMESTAMP,
[CSDATABASE].[dbo].[cs_Sections].TotalPosts,
[CSDATABASE].[dbo].[cs_Sections].TotalThreads
FROM [CSDATABASE].[dbo].cs_Sections
where [CSDATABASE].[dbo].cs_Sections.GroupID = '34'
-- Building forum posts
SET IDENTITY_INSERT [DNNPE_DEV].[dbo].[Forum_Posts] ON
INSERT [DNNPE_DEV].[dbo].[Forum_Posts] (
[PostID]
,[ParentPostID]
,[UserID]
,[Subject]
,[Body]
,[CreatedDate]
,[ThreadID]
,[PostLevel]
,[TreeSortOrder]
,[FlatSortOrder])
SELECT
[CSDATABASE].dbo.cs_Posts.PostID,
[CSDATABASE].dbo.cs_Posts.ParentID,
[CSDATABASE].dbo.cs_Posts.UserID,
[CSDATABASE].dbo.cs_Posts.Subject,
[CSDATABASE].dbo.cs_Posts.Body,
[CSDATABASE].dbo.cs_Posts.PostDate,
[CSDATABASE].dbo.cs_Posts.ThreadID,
[CSDATABASE].dbo.cs_Posts.PostLevel,
[CSDATABASE].dbo.cs_Posts.PostLevel,
[CSDATABASE].dbo.cs_Posts.PostLevel
FROM [CSDATABASE].dbo.cs_Posts
WHERE SectionID = 108 or SectionID = 109 or SectionID = 110 or SectionID = 111
-- Building forum threads
INSERT DNNPE_DEV.dbo.Forum_Threads (
ThreadID,
ForumID,
Views,
LastPostedPostID,1
Replies)
SELECT
[CSDATABASE].dbo.cs_Threads.ThreadID,
[CSDATABASE].dbo.cs_Threads.SectionID,
[CSDATABASE].dbo.cs_Threads.TotalViews,
[CSDATABASE].dbo.cs_Threads.MostRecentPostID,
[CSDATABASE].dbo.cs_Threads.TotalReplies
FROM [CSDATABASE].dbo.cs_Threads
WHERE SectionID = 108 or SectionID = 109 or SectionID = 110 or SectionID = 111
A couple of things I've found thus is that DNN uses 0 for the ParentPostID column on a new thread, I've also created a new post thru the DNN UI to see what columns I didn't auto populate so I manually updated: In Posts ( DateApproved, Notify, RemoteAddr ) In Threads ( PollID )
I'm sure I'll figure it out eventually but thought I'd ask to see if anyone has already done this.
|