Upgrading Community Server 2.1 to 2008.5 Service Pack 1

I’ve been a bit stuck with blog engines. I run Community Server and have done for a long time and, during that time, the product’s become very big and very rich and I only use about 10% of what it does. I just want a blog engine.

I was recently considering what to do about this as I’ve been getting behind on Community Server versions. I tried Graffiti CMS which looks to be a fork of Community Server designed for people like me who just want the blog engine bits but, frankly, whilst the UI looked great and it seemed so much simpler than Community Server I found that the migration process from Community Server didn’t really work for me and I was also left wondering whether the product was very “alive” as there’s quite a bit of discussion out there about it dying off and my questions to the forums went unanswered.

So, I returned to Community Server and decided that it was time to upgrade to the latest and greatest and I thought I’d blog my experiences for anyone else that has the same situation.

Firstly, let me explain my setup;

  1. Community Server – reported version is 2.1.61129.2 ( wow, hope that’s a build number and not a version! 🙂 ) and it’s running on ASP.NET 2.0
  2. Website is hosted for me so I have access to the files via FTP and ( this becomes important later on ) I also have access to the SQL Server that hosts my data which is SQL 2000

As far as I can work out, you can’t go straight from CS2.1 to CS 2008. You need to go via CS 2007. Fair enough.

Now, the first time I tried this I failed completely and that was because I managed to just about get to CS 2007 by running database update scripts on my SQL Server before I realised that the upgrade from CS 2007 to CS 2008 didn’t want to work that way and is factored as an executable program that wants to see both the Community Server files and the database.

So, I gave up on that attempt and tried something else. Good job I’d tried my upgrade on a copy of my live database rather than the original but, then, I guess everyone does that and that’s definitely what the Telligent guys advise.

So, here was my procedure for upgrading;

  1. Copied entire set of files from my hosted CommunityServer 2.1 virtual directory to my local filesystem via FTP.
  2. Copied the data from my hosted Community Server 2.1 database ( SQL 2000 ) to a local database ( SQL 2008 ). I did this by backing up the database on the hosted end ( the web hoster has a UI for this ), copying the file down over FTP and then restoring the backup to a new database locally.

I then went away for many hours whilst this little lot ran because the SQL transfer wasn’t so long but the file transfer via FTP took ages.

I then took a good, long look at the ( slightly complicated imho ) Community Server downloads page and pulled down a few of the files with upgrade in their title 🙂

Upgrading to Community Server 2007.1

I unzipped the file CS2007_3.0.20611.960.web.zip and took a look at the READ_ME.txt file. It said;

  1. Read the HOW_TO_SETUP_DATABASE.txt and upgrade your DB
  2. Ideally, copy the web files to a new location on your website for CS 2007.
  3. If you can’t do (2) then copy the web files over the top of your existing files.

So, I decided to do (1) first. I read the file which essentially said to look in a folder called Upgrade_From_Previous_Versions and execute cs_2.x_to_3.0_upgrade.sql.

This wasn’t the first time that I’d run this script so I knew that I was going to hit an error if I ran it;

Creating…cs_Schema_Patch_3.0.04
Msg 208, Level 16, State 6, Procedure cs_Section_Delete, Line 7
Invalid object name 'cs_Section_Delete'.

I found someone else with the same experience here;

http://dev.communityserver.com/forums/t/498660.aspx

and so I made sure that I’d executed this bit of script before running the other script;

exec sp_ExecuteSQL N'ALTER TRIGGER cs_Section_Delete ON cs_Sections
    FOR DELETE
    AS
    BEGIN
        DELETE cs_SectionPermissions WHERE SectionID IN (SELECT SectionID FROM DELETED)
        DELETE cs_Threads WHERE SectionID IN (SELECT SectionID FROM DELETED)
        DELETE cs_ThemeConfigurationData WHERE SectionID IN (SELECT SectionID FROM DELETED)
    END'

and then I ran the upgrade script and it ran through fine 🙂

Next, I decided to not go with option (3) above but, instead, to go with option (2) and copy the new CS 2007 web files over the top of my existing ones ( my local copy anyway, not the actual files on my web server ) and so I did that. Not surprisingly, that worked ok – it’s just a file copy 🙂

Upgrading to Community Server 2008

I now wanted to get to Community Server 2008. I first looked at the package CS2008_SP1_4.0.30619.63.web.zip but couldn’t find anything about upgrading in there and so I then looked at the package CS2008_SP1_4.0.30619.63.upgrade.zip which has a .EXE inside it that can do the upgrade for you.

This is why I copied everything locally in the first place because I knew that I was going to have to run this package – there no longer appears to be an option to just run some SQL scripts and copy a few files, you’re meant to use this .EXE which isn’t “so easy” in a hosted environment.

Anyway, I set about running the .EXE and then I realised that it asks for the location of your community server files locally, opens up the configuration file and tries to talk to the database in there. Hmm. Not what I want to have happen because the connection string it’s trying to use has just been ( luckily ) over-written by my copying the CS2007 files over the CS2.1 files. Otherwise, this thing might have tried to talk to my real database out on the web and tried to upgrade my live database.

So, I changed the connectionstrings.config file to point to my local ( 2007 ) database and managed to get the tool past the 1st screen. It then asks you for the location of file galleries, photo galleries, forum post attachments, blog post attachments. As far as I know, I have never used any of these features so I just let them all default and ran the tool.

The tool ran through perfectly until it hit “Step 6: Move existing files into centralized storage” and then it through an error dialog with “Object reference not set to an instance of an object”. It emits a log file though and that log file had;

21/06/2009 21:01:08 — Executing Step 6: Move existing files into centralized storage
21/06/2009 21:01:09 — Removing dangling files
21/06/2009 21:01:09 — Upgrading file galleries
21/06/2009 21:01:09 — EXCEPTION: Object reference not set to an instance of an object.
   at CommunityServer.Upgrader.FileUpgrader.UpgradeStorageType(ApplicationType type, String filePath)
   at CommunityServer.Upgrader.Part4.MoveFilesToCfs()

I found a post here that referenced the same error and it perhaps made me realise that you were supposed to copy the CS 2008 files over the top of the CS 2007 files yourself before running the upgrade tool – somehow I thought the tool would do that.

So, I re-did the process and that worked just fine 🙂

Upgrading to Community Server CS 2008.5 or maybe CS 2008.5 Sp1

In order to move to CS 2008.5 Service Pack 1, I revisited the downloads page and realised I’d missed;

image

which gave me package CS2008_SP1_4.0.30619.63.upgrade.zip which looked to follow the same model of “copy the web files over your web files and then run the upgrader program” and that all seemed to run through fine.

Upgrading to Community Server CS 2008.5 Sp2

This one looked to be back to the previous mechanism of copying files into the web folder ( and also copying some assemblies into the bin folder ) and then running a SQL script.

So, with that, I’ve got a bunch of files and a new database that need uploading back to my website to see if any of this works.

If you’re reading this post then I should be on CS 2008.5 Sp2 🙂

Outlook 2007: "The Text Formatting Command is not Available"

Hmm.

I was reading my mail this morning. Shutdown Outlook to do something else ( I do this, I don’t like leaving Outlook running otherwise it eats your day ).

I run it up later on and notice that the reading pane isn’t displaying the selected mail. I double click on a mail and Outlook tells me;

“Unable to display mail. The Text Formatting Command is not Available”

Weird! All I’ve done since I last ran Outlook is to do some stuff in Visual Studio. I didn’t think that would have broken Outlook 😦

I do a bit of a search and the only KB article I can find is;

http://support.microsoft.com/kb/235244/en-us

which tells me to uninstall/reinstall IE but that seems a bit scary in that I have IE8 whereas this article was written around IE4 which feels like a very long time ago.

I opt to do a “Repair” on “Office Enterprise 2007” and see if that resolves anything for me.

And…it does. Or maybe it does. It asks me to reboot and I don’t feel confident enough to ignore it so I let it reboot the box and when it comes back up I can read mail once again in Outlook. So, either the reboot fixed it or the repair fixed it but either way it’s back and alive.

Using Excel as an XML Editor

In a couple of instances recently I’ve had cause to take data that exists in an Excel spreadsheet and save it out as XML and, whilst it’s slightly off-topic, I thought I’d share as I find it “enjoyable” 🙂

I don’t mean as a .XLSX file but, rather, as an XML file according to my own schema.

Let’s say I sketch out some XML file format by running VS and coming up with something like;

<videos>
  <video title="Using Excel for XML Editing"
         author="Mike Taulty"
         duration="120"/>
</videos>

I can then get Visual Studio to infer a schema from this giving me something like;

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="videos">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="video" minOccurs="1" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="title" type="xs:string" use="required" />
            <xs:attribute name="author" type="xs:string" use="required" />
            <xs:attribute name="duration" type="xs:unsignedByte" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

I know that’s a very imprecise science (schema inference) but I don’t really mind here although I did tweak it just to add the minOccurs and maxOccurs facets on there.

Now, I can drop into Excel and create a new spreadsheet and on the Developer tab I can associate my schema with the sheet by clicking “Source”;

image

and adding an XML map;

image

and then dragging and dropping items from that map to the spreadsheet;

image

to the spreadsheet cells that I want to associate with that schema and “BOOM!” 😉 I get;

image

and then I can just edit my XML;

image

and then click Export from the Developer Tab;

image

and save the resulting XML. Cool! Nice and easy way to create XML. As an aside, you can also import data this way ( with the import button ) and I recently found that to be really useful because I wanted to gather all the details of the videos that we have published on the UK MSDN site into an Excel spreadsheet for discussion.

I was about to write some C# code to do this when I realised that I could just do Import from Excel, point it at the live RSS feed and it would just magically drop that into a spreadsheet for me with the XML association. Very neat.

By the way – if you’re missing the Developer tab in Excel you need to go to the Office Button, hit the “Excel Options” button;

image

and then go and select to show the developer tab;

image