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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Importing data from another CMSImporting data from another CMS
Previous
 
Next
New Post
1/7/2011 8:10 AM
 
Greetings all

I'm new to DNN but quite excited about what I've seen so far. I need to convert an old legacy ASP site with its own custom written CMS system to DNN. Is there any documentation on DNN's ERD model and what is required to generate content for it? I will need to write once off SQL scripts probably to export data from my legacy CMS (also in MS SQL) to the DNN SQL tables. I was thinking of creating the main structure manually via the DNN GUI and then I'd at least have a list of page-ids or menu-ids? in the DNN tables somewhere, I'm guessing?? Not sure that would help...

Any ideas or direction would be appreciated.

Cheers
Neville
 
New Post
1/7/2011 5:17 PM
 
Hello and Welcome! There are a number of community efforts to create entity relationship diagrams (ERD) such as those from Chris Smith or r2i e.g. http://www.r2idnn.com/Blog/BlogEntry/... . However, in general we recommend you don't do direct database access, as there are often dependencies that are not obvious e.g. when you create a page it also creates page permissions. As such we recommend you use the public API (i.e. the methods the core uses itself) - you can download the API documentation at http://dotnetnuke.codeplex.com/releas... . For instance to create a new page, you create a tabinfo object and use the tabcontroller to create it (tab's are the name for pages in dotnetnuke due to legacy reasons) e.g. (note, i have not tested this, it should be reasonably close)

Dim t As New DotNetNuke.Entities.Tabs.TabController
Dim TI As New DotNetNuke.Entities.Tabs.TabInfo
Dim current As DotNetNuke.Entities.Tabs.TabInfo = t.GetTab(TabId, PortalId, True)

'write your database query here to get your data from the legacy cms

Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As New SqlDataReader()
myConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=pubs")
'establishing connection. you need to provide password for sql server
Try
myConnection.Open()
'opening the connection
myCommand = New SqlCommand("Select pagename,pagetitle from legacycms_pages_table", myConnection)
'executing the command and assigning it to connection
dr = myCommand.ExecuteReader()
While dr.Read()
'reading from the datareader

TI.TabName = dr("pagename")
TI.Title = dr("title")
TI.ParentId = current.TabID
TI.TabID = Null.NullInteger
TI.PortalID = current.PortalID

For Each pr In current.TabPermissions
TI.TabPermissions.Add(pr)
Next
TI.IsVisible = False

t.Addtab(ti)

End While
dr.Close()
myConnection.Close()
Catch e As Exception
End Try



Finally, if you do decide to use direct database access, then http://www.dnncreative.com/Forum/tabi... has links to a number of useful options.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/10/2011 3:58 AM
 
Thanks for that. Much appreciated. Will definitely have a look at the API.

Cheers
Neville
 
New Post
1/11/2011 7:23 PM
 
I added a wiki page with some notes on this at http://www.dotnetnuke.com/Resources/Wiki/tabid/1409/Page/Create-a-new-page-programmatically/Default.aspx

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
1/13/2011 5:23 AM
 
Thanks. Looks good but I'm a bit lost... where do I write this code? In another ASP.net page that runs within the same DNN site I want to update?

The API looks good but I have no idea where to even start using it...

Any chance I can use it from a Windows Forms application? Is it as simple as referencing the API DLL's from my WinForms project? How do I "connect", for lack of a better term, to the DNN portal from within my code?

I'd need to write an "import tool/app" that could be rerun at any stage to import my data from the old proprietary CMS DB to DNN. I read a post somewhere of someone using SSIS to do this but I suspect he used direct DB access instead of the API...
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Importing data from another CMSImporting data from another CMS


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