NOTE: the solution should work well in DNN Standard Blog Module 3.5.1 and SunBlogNuke 3.x and just tested in the above environment.
As mentioned previously on that post Ultimate DNN Blog Module – SunBlogNuke Roadmap, we are trying to develop the import feature for SunBlogNuke. I have seen multiple posts around our forum asking if there were any migration tool away from the core blog module and well now there is! In this blog post I want to share a SQL script, which will migrate all blog posts from the core blog to the SunBlogNuke module.
As with all other postings regarding database modifications to DotNetNuke, I am not responsible for any errors that might occur by executing the below scripts on your site. I have tested and used the below scripts however due to the vast differences in DotNetNuke installations you must not only follow my instructions but also perform sanity checks on the datasets to ensure that your setup doesn't require modifications to this process.
What does it do?
NOTE: once your run this THERE IS NO TURNING BACK; BACKUP YOUR DATABASE, PRIOR to executing this script in order to avoid any data loss.
In order to provide you with a transparent view of what the script really does to your data, I will outline a step-by-step execution path that it takes to wipe the slate clean and begin the process of the transforming your blog to the new blogging platform – SunBlogNuke paradigm:
- INSERTS any existing user INTO the BlogUsers for a given blog and assigns it as default BlogOwner.
- INSERTS any existing Child Blogs INTO the CATEGORIES table (The Child Blog’s title becomes the title of the new category).
- COPIES any existing POSTS into the ENTRIES table of new Blogging module.
- REFERENCES any existing POSTS found under the child blogs TO the newly created CATEGORY.
- COPIES any existing COMMENTS into the COMMENTS table of new Blogging module.
How to run the script:
Before you begin, locate the BlogId of the blog you want to upgrade and the BlogId of the destination blog:
- At the top of the script, set the value of @SourceBlogID to the ID of your dnn core blog and the value of @DestinationBlogID to the ID of new SunBlogNuke blog.
- Save this script on your local machine using a descriptive name for example "CoreBlogToSunBlogNuke_Convertion.sql”
- Log into your site using your HOST account
- Navigate to HOST > SQL
- Choose the file you saved using the "Browse" button
- Select "Run as script"
- Execute the SQL
At this point, all entries of your blog on your portal are now completely converted to SunBlogNuke – and once again, there is NO GOING BACK, unless you want to restore your database, of course.
Simple: automate this process and make it as a built-in feature into SunBlogNuke.
We realize that this manual process is not ideal, but we simply did not get a chance to automate it yet; the bright side of it is that it forced me to write this blog post which reveals exactly what goes on during the upgrade. We hope to include the automated process in our next Building round – oh yeah, we’re planning on more of those.
Finally, we need you to help us test, too. Testing this scenario is extremely important to the success of this major release, and we want to ensure that we get it right the first time!
Conclusion and Parting Thoughts
The above information should allow you to migrate your blog data to the SunBlogNuke module via a fairly easy to follow scripting process. I would like to simply remind everyone again that you MUST sanity check these scripts and the data that they will be inserting PRIOR to actually inserting the records into your database. As with all data operations there are risks of damage to the database if you incorrectly insert/update data, therefore I fully recommend taking backup of your database prior to performing any updates.
Please provide any feedback regarding this process below and feel free to use the forums for script assistance if needed!
You may download a SQL file with the above scripts by clicking here.
The SunBlogNuke Team
Want automatic updates? Subscribe to our RSS feed
Get Email Updates
sent directly to your inbox!