/* Blog -> News Articles Migration Scripts Created by: Mitchel Sellers Website: http://www.mitchelsellers.com NOTICE: These scripts have been provided for your reference and are to be used at your own risk. Mitchel Sellers and IowaComputerGurus L.L.P. hold no responsibility for any adverse actions that might take place from using the below referenced scripts. These scripts MUST be updated to contain your DNN specific implementation information! */ --BEGIN: Module ID Location Script --Ensure that the ModuleTitle is the title of your module select m.ModuleID, m.ModuleTitle from ModuleDefinitions md INNER JOIN modules m ON (md.ModuleDefId = m.ModuleDefId) WHERE md.Friendlyname = 'DnnForge - NewsArticles' --END: Module ID Location Script --BEGIN: Migration of blogs with summaries! --Insertion for pages with summary! --PART 1 INSERT INTO dnnForge_newsArticles_Article( AuthorID, ApproverId, CreatedDate, LastUpdate, Title, Summary, IsApproved, NumberOfViews, IsDraft, StartDate, ModuleId, IsFeatured, LastUpdateID, IsSecure, IsNewWindow) SELECT 3, --ID of the adding user (Obtained in step 1) 0, --0 for no approver GETDATE(), --You are adding it now GETDATE(), --You are updating it now b.Title, --The actual Title b.Description, --The description (Summary) 1, --Yes it is approved 1, --It has been viewed once 0, --No it isn't a draft b.AddedDate,--Keep the orig post date 598, --Your Module Id (Obtained in step 1) 0, --Not Featured 3, --Last updator 0, --Not a secure post 0 --Not a new window FROM Blog_Entries b WHERE Description != '' AND Description IS NOT NULL --PART 2 --RUN this after you have actually inserted the main entries --This actually migrates the detail of the pages INSERT INTO dnnforge_newsarticles_page( ArticleId, Title, PageText, SortOrder) SELECT na.ArticleId, --The id of the new article na.Title, --The title of the article b.Entry, --The detailed entry text 0 --Sort order of 0 as this is the only page FROM Blog_Entries b INNER JOIN dnnForge_newsArticles_article na ON (b.title = na.title) WHERE b.Description != '' AND b.Description IS NOT NULL --END: Migration of entires with summaries --BEGIN: Migration of entries w/o summaries --Part 1 - Migration entries without summary information INSERT INTO dnnForge_newsArticles_Article( AuthorID, ApproverId, CreatedDate, LastUpdate, Title, Summary, IsApproved, NumberOfViews, IsDraft, StartDate, ModuleId, IsFeatured, LastUpdateID, IsSecure, IsNewWindow) SELECT 3, --ID of the adding user (Obtained in step 1) 0, --0 for no approver GETDATE(), --You are adding it now GETDATE(), --You are updating it now b.Title, --The actual Title b.Entry, --The description (Summary) 1, --Yes it is approved 1, --It has been viewed once 0, --No it isn't a draft b.AddedDate,--Keep the orig post date 598, --Your Module Id (Obtained in step 1) 0, --Not Featured 3, --Last updator 0, --Not a secure post 0 --Not a new window FROM Blog_Entries b WHERE (Description IS NULL OR Description = '') --BEGIN: Migration of entries w/o summaries --BEGIN: Migration of blog comments --Copy all comments!! INSERT INTO dnnforge_newsArticles_comment( ArticleId, UserId, CreatedDate, Comment, RemoteAddress, [Type], AnonymousName, AnonymousEmail, NotifyMe) SELECT na.ArticleId, --Our new Article id -1, --Do Not associate it with a user bc.AddedDate, --The date they made the comment bc.comment, --The actual comment '192.168.1.1', --An Ip address I just defaulted it 0, --Comment type bc.Author, --Entered name of the user 'msellers@iowacomputergurus.com', --An e-mail for notification 0 --Do not notify user of replies... FROM Blog_comments bc INNER JOIN blog_entries be ON (bc.entryId = be.entryid AND bc.Approved = 1) INNER JOIN dnnForge_NewsArticles_Article na ON (be.title = Na.Title) --END: Migration of blog comments