Friday, 11 June 2010

Auto-publish custom parts to Blackbaud Netcommunity

I always found it to be a bit of a pain to publish custom parts to Netcommunity - build the project, publish it, move the .dll file to the \bin folder and the .ascx files to the Custom folder etc. So I've made a little tool that will hopefully make it a bit easier.

It's a C# console application - the first time you run it, it asks for the paths to your Netcommunity \bin and \custom folders, and the path to your Visual Studio projects folder. Once you've done that once, it will store them for next time you run it.

It then asks you for the name of your Project - it searches for that project, and if it finds it the files (including .dll) are copied to the right places in the Netcommunity folder.

The best thing is that you can set up Visual Studio to run the program automatically every time you build a project - the program recognises that it is being called from Visual Studio, and does everything without asking for confirmation, automating the whole process.

As long as you run the file once by hand to set up the paths it needs, from then on you can get Visual Studio to run it automatically - here's how:

Adding Build Events to Visual Studio

In Visual Studio, go to 'Project' then '[Project Name] Properties'.
Click the Build Events tab.
In the 'Post Build Events' box, type the following:

cmd
cd C:\BBNC_Pub
BBNC_Copy_Data $(ProjectName)

The one bit you'll need to change is "C:\BBNC_Pub" - put in whatever directory you've stored the program in.

The above simply opens a command line, changes to the folder where the copying program lives, and then runs it with the name of your project as an argument. This causes the program to automatically find and copy the project files to the Netcommunity folder.

Do that for every project you create, and you're good.

Disclaimer - the program was quickly hacked out, probably has lots of bugs, etc etc. If it wrecks your computer, then that's too bad.

You can download it here - it's an .exe file. Save it to somewhere like C:\BBNC_Pub\, then run it and enter in the relevant paths. Once you've done that, you can either open the program manually and search for a Project, or get Visual Studio to run it automatically for you.

Let me know if you try it!

Friday, 4 June 2010

Setting up a Blackbaud Netcommunity / Raiser's Edge test environment

In steps, how we went about setting up a test environment for Blackbaud Netcommunity & Raiser's Edge, that duplicated (as close as possible) our live setup.
  • Get the hardware to run it on
Our live setup is three servers - a Netcommunity application server (holding the application & web services), a Netcommunity database server, and a Raiser's Edge server. We're still running Netcommunity 5.6, so all three of those servers are running Windows Server 2003.
For the test environment, we decided to go down the route of using Virtual Machines - 3 VMs that are running Windows Server 2003, running on the host server which is a powerful Windows Server 2008 R2 server. The VM software we are using (Hyper-V, which is built into Server 2008) is great, you can easily take snapshots of the state of the servers and restore to them later, and make all sorts of changes.
  • Install the operating systems onto the hardware
As above, we are currently still on BBNC 5.6, so we're using Windows Server 2003. We're going to use this test environment to upgrade to the latest version soon, and see how it goes - that's the great thing about virtualisation. If it doesn't work out, we just restore the old VMs.
  • Install Raiser's Edge onto RE server
Once all the server OSs have been patched up fully, install Raiser's Edge onto the RE VM. This was relatively painless, but took a little while. We did have problems with the installation detecting our existing Raiser's Edge installation (the live one) and confusing itself (the VMs are on the same network as our live setup) - we then had to uninstall it and run the process again. Blackbaud support were helpful with that.
  • Install Raiser's Edge client onto Netcommunity application server
This needs to be present in order for the web services to work properly - pretty straightforward to install, we didn't really have any problems.
  • Install Netcommunity database onto Netcommunity database server
This was also pretty straightforward - installing the BBNC DB is simply a case of running the BBNC installation file and choosing 'custom' to just install the database.
We did have to do some messing around with the database later on, once the Netcommunity application was installed properly - the recovery mode of the database needs to be set to 'simple' and a backup needs to be performed. Other minor configuration tweaks might be needed, but the best thing to do is either check Blackbaud's knowledge base or give them a ring.
  • Install the rest of Netcommunity onto the application server
Next, we installed the rest of Netcommunity onto the application server - the application itself, the web services, etc. Once that was done, I tried to open the Netcommunity admin page. It failed straight away. Eek.
In order to get it to work, we needed to grant permissions to various files & folders to an account named NETWORK SERVICE. We also had to change the recovery model of the database (as above), and we had a few problems with the Netcommunity installation package not working properly - uninstalling Netcommunity, removing all the temporary files it leaves behind, and trying again seemed to sort that one out.
Once the admin page came up successfully, I loaded the testconfig.aspx page (your-url.net/netcommunity/testconfig.aspx) to see if anything else was awry. During the application installation process it asks you for Blackbaud Services login details - we didn't need to use this, so we just put gibberish in instead. I understand that installing a more recent version of Netcommunity requires you to enter Blackbaud Payment Service info - I guess you may have to put the live info into there for it to work. We also had a few problems with the web.config file that needed to be adjusted, but again, the knowledge base was very helpful with sorting it out.
  • Restore the live databases to the servers
The next, and optional step is to backup the live databases for both Raiser's Edge and Netcommunity, and restore them to the databases in the test environment. That way you will have a relatively recent version of your live setup, duplicated onto your test servers.
Bear in mind that things like customisations are not stored in the database and will therefore need to be copied across manually.
Our next step is to trial out the latest version of Netcommunity, and see how we get on - we have a lot of custom parts that could potentially get broken. Hopefully not.