How to upgrade Composite C1 Blog Package

Tonight I had some issues with my blog module in Composite C1 and wanted to upgrade it to the newest package which included Razor Functions instead of the old Xml Functions. This is not a trivial task in C1 and therefore I am sharing how you can do it.

To upgrade the blog package you will need to uninstall the current package and install it again. In my case I vent from 1.8.2 to 2.0.5 without problems. Before uninstalling you want to backup your old posts such you can put them in again after you have upgraded. 

In my case, using the XML store, this was as easy as zipping the relevant files from App_Data/Composite/DataStores. The files are all those starting with Composite.Community.Blog, mark them, right click and add them to a archive in the windows explorer. 

Next we need to uninstall the package. You can do that from the C1 Console system perspective. Next, it is also needed that you manually remove the page types from the Layout perspectives. To do that you will need to remove it from the blog pages also. (I just deleted the blog page).

Now you are done and can install the package again and you will get the newest version including all the Razor Functions. Install it, add a page with the blog page type that was installed again. You will now see that no blog posts exist. So lets restore the files you zipped earlier and restart the site. You still wont see any blog posts. This is because they are all linked to the old page ID that we removed. So you will manually have to update those. 

To update the pageids, create a new blog post just with a title test. Go to the xml data store and find the Entries_Published.xml and find your new blog post and one of the attribute will be PageId. Now update all the others (find and replace) to this new guid. Do the same for the Entries_Unpublished.xml. 

Restarting the site and you should now be able to see all the old blog posts and you can delete your test post. You now have Razor functions and can start play around with them to tweak the rendering.



comments powered by Disqus