• jschlosser
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
6 years ago
I will be integrating YAF into an existing DNN 9 site. We are currently using the built in forums from DNN and will need to migrate that data as well. Any suggestions/scripts or other help will be much appreciated!




6 years ago
I just did the same since DNN Forum's won't work properly; on a development box and will be copying over the db and files once it appears everything is good to go.

I was unable to find any update scripts, nor anything like that and ended up having to manually enter all the topics in, one-by-one. We had 191 and it took me a little over 4 or 5 hours to complete.

Below (if it pastes correctly) is the main script I used to get a listing of the current groups, forums, subject, body, etc. from the current forums; 10 at a time.. I then used this for entering each entry in via YAF.

I also had to reset all the user passwords so that I could log into the system as them to add and entry. I have another script which does a group by of the users which have made postings to the current forum so you can see who's made postings and you can change their passwords.

I have other scripts which I can try to post which once done with everything, configure the user ip's, posted dates and times, etc. so that everything matches according to what DNN Forums has.

NOTE: I had to put a space between the single quotes (') and the ending parenthesis because the forum was posting a winky face; as you can see.

/****** Script for SelectTopNRows command from SSMS ******/
TOP 10 ROW_NUMBER() OVER (ORDER BY Forum_Posts.CreatedDate) AS No,
Forum_Groups.Name as [Group Name],
Forum_Forums.Name AS [Forum Name],
REPLACE(REPLACE(Forum_Threads.IsPinned, '1', 'Yes' ), '0', 'No' ) AS IsPinned,
REPLACE(Forum_Posts.Subject, '&', '&' ) as Subject,
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Forum_Posts.Body, '&', '&' ), '%3a', ':' ), '%2f', '/' ), '>', '>' ), '<', '<' ), '"', '"' ), ' ', ' ' ), '’', '''' ), '“', '"' ) AS Body,
Forum_Groups.GroupID as [Group ID],
Forum_Forums.ForumID as [Forum ID]
FROM Forum_Posts INNER JOIN Forum_Threads ON Forum_Posts.ThreadID = Forum_Threads.ThreadID INNER JOIN Forum_Forums ON Forum_Threads.ForumID = Forum_Forums.ForumID INNER JOIN Forum_Groups ON Forum_Forums.GroupID = Forum_Groups.GroupID LEFT OUTER JOIN Users ON Forum_Posts.UserID = Users.UserID
--where Forum_Posts.CreatedDate > '2017-10-25 08:00:00.000' -- Inserted up to this point
ORDER BY Forum_Posts.CreatedDate

/****** Script for SelectTopNRows command from SSMS ******/
SELECT Forum_Posts.UserID, Users.Username
FROM Forum_Posts INNER JOIN Users ON Forum_Posts.UserID = Users.UserID
GROUP BY Forum_Posts.UserID, Users.Username
  • jschlosser
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
6 years ago
Interesting. I had to do the same to set up the individual forums and sub-forums when moving from php to dnn. Only had about half that many. I see the select statements provided but no sign of YAF. Mostly, though, what is this about resetting passwords? I thought there was a way to integrate YAF with a DNN site which, to me, includes some form of SSO. I may end up just fixing the DNN forum and living with it.

Keep us posted on how this works out!

Thanks for sharing!

6 years ago
The first SQL script is run against the existing DNN Forum tables to get the information stored in them.

By the time this script is run, the YAF extension has been installed, the module setup, and the categories and forums configured So when you're doing a manual entry of all the topics, it'll show the category and the forum, the topic and it's information as it was entered in the original DNN Forum postings. The listing is sorted by the CreatedDate so you can enter them into YAF as they were originally posted in DNN Forum.

The second SQL script does a listing of the DNN Forum Posts table and does a group by of the user accounts which have posted to the DNN forums. I then used this list to update the passwords of the users which made posts. Since DNN has it's own user management, you have to change passwords via DNN and not the user functions of YAF.

After everything is entered, I have an additional six (6) SQL scripts which create UPDATE scripts (from the live DB and DNN Forum) to move over the true created/updated dates of posts, number of views, IP addresses, etc. And since I was working on a development box, updated to the original password and hashes for the user accounts so they were reset back to what they were originally.

Just figuring everything out took me about two weeks of prep to get configured and working properly. Thank goodness for virtual machines and snapshots. Mess something up, restore previous snapshot and try again. ha-ha..
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button