How I do Community Server Upgrades
I know, most of you have done this a million times, and I am not trying to teach anyone that already knows with this article. I just wanted to write some pretty good practices on how I do it after learning from some mistakes in the past. Some of the mistakes I did on live sites, put the site down for a couple of days, and I had to do a restore from a backup I fortuneatly had. :-)
First, I'd like to mention the tools I use. Depending on wether you're using a hoster or hosting on your own machine at home etc, some of the tools might not be needed. And all of the tools have alternative brands from the ones I am using. So what I commonly use are:
FileZilla - FTP Program for shuffling files between my computer and a hosted site. I have used a couple of different FTP programs before, some good and some bad. I recently started using FileZilla, and I really like it. It does the work I need to do.
WinMerge - A visual text file differencing and merging tool which I use mainly for updating my config files. The config files may change between builds and versions, so just replacing the new ones, with your old ones won't do it.I use it for a couple of other files as well.
SQL Server Management Studio Express - A free version of the SQL 2005 Management Tool. Works with SQL 2000 Servers as well. Good for running the upgrade scripts on your DB and actually any work you need to do on your SQL DB.
Notepad - Yeah, I use notepad to do any add-hoc changes to any of the webfiles, unless there's a need for WinMerge. I guess I should use Visual Studio when editing .config files. But somehow I tend to use notepad instead. Mostly I believe cause it loads faster. ;-)
All the above tools are free to download within their respective license. I am by no means a licenese expert, so it's no good asking me about the details of each license. But they should be available to reach on each link above.
So now I got the tools I need, and I can start the update. The updates have been almost the same routine since long back. Upgrade the DB and copy the new webfiles. In my opinion the DB upgrades have been getting smother during time. I believe Telligent have done a good work simplifying this for us. For example, there's no longer one upgrade file for each version to upgrade from.
The Configuration Files
The first thing I do when I am upgrading is making a backup of the DB and the web files......did you believe that? ;-) I don't always, but it's a good practice of course if you care about, and are serious about your site. Then I have a work folder where I put the main config files from the existing site:
- Web.config
- CommunityServer.config
- SiteURLs.config
Since I don't currently do a change log for when I do changes to my site, these are in my opinion the most important files. I want to be sure to get the changes I might have done to these over to the upgraded site, or the upgraded site might not even work at all. Another file that I commonly put in my work folder is default.aspx. This is because I usually make changes to this one on any site I run.
When I have my original versions of these files in my work folder, I rename them and put a .OLD extension on all of them. Then I copy the same 4 files from the new version of CS that I am upgrading to, and let them keep their names. Then it's just a matter of selecting for example Web.Config.OLD and Web.Config, right click and choose WinMerge. In WinMerge I can easily see what parts of the files that differs.

On the left I see two bars that represents each of the two files I've opened. The yellow and grey areas are where in the files there are differences found.

Click to view original size
To the right I have two Text Windows with the two textfiles. The differences is color coded there as well. Doubleclick on one of the changes, and then right-click it to get options to copy right or left etc. (Sorry for the swedish version I use in the screenshot above).
When I have gone through all the files listed above, I have my sites config files in new versions, ready to upload after upgrading the DB and copying the new webfiles.
Upgrading the SQL DB
Just open the SQL Management Tool (SMT), fill in the DB and login info. With SMT open up one of the .SQL files found under the SqlScripts folder that came with your CS download. Read the HOW_TO_SETUP_DATABASE.txt to know which file to use. Make sure the script window is connected to the right DB, and choose run. This may take a while if you connect to a hoster. I have actually run the script against my master DB one time, and couldn't figure out why my site didn't work afterwards. So now I always doublecheck that I am connected to the right DB.

Click to view original size
Copying the web files
Assuming I have extracted the CS files from the .ZIP download, I just fire up FileZilla, connect to my host, and copy all the files under the Web folder (on my local computer) over the web files on my site. Sometimes I've had problems with a couple of .DLL files that where locked and couldn't be replaced, so I had to wait for a while for them to be released. I don't know if this was dependent on which FTP client I used. The copying can also take quite a while depending on your connection. Many FTP clients shows you files that weren't uploaded for some reason, make sure to try to upload them again, until all files are updated.

Click to view original size
Uploading your Config Files
So now I've upgraded the DB, copied the new web files. But of course nothing will work until the configurations are correct. So now I use FileZilla to upload the four files I talked about in the beginning of this article. After that is done, all should be ok and your upgraded site should appear when you browse to your site.
Other considerations
What I have described above is a very simplified approach. But I believe it works for many upgrade scenarios. Besides the four config files that I talk about in this article, there might of course be numerous other changes you've done. Another common source for changes are the Themes folder. You might have changed just some of the CSS, or changed almost everything. For these changes you might use WinMerge as well, unless you know that the Theme architecture haven't changed between the versions, in which case you might just drop your old Theme folder from a backup, into the upgraded site.
Another thing, that I am thinking of doing, but probably never will, is having a change log where you log ALL changes you do to any web file of your site. Then use them in the WinMerge scenario I described above. Or use another tool if you need some more advanced features.
Feel free to comment with some of your own good practices on upgrading. Anyone that uses some kind of source control tool for the web files?
If you enjoyed this post Subscribe to my feed via RSS or e-mail!