IIS 7 Backup Strategy

backupiisiis-7windows-server-2008

I did notice this post but am looking for more specifics.

I have 2 servers running Windows 2008 Server Web Edition and am running websites on both of them. I would like to be able to mirror IIS settings onto each box from the other so that, in event of a 'server 1' crash, I can log into 'server 2' and quickly get all sites that were running on 'server 1' up and running. This isn't a simple mirror as I already have sites on 'server 2' that need to stay running, so basically I want to add the sites from 'server 1'.

I am sure I will get some comments about this, so yes, our servers can handle the increased load. I also want to stay away from discussing DNS so please let's not do that. I also realize I would need to add specific IPs to the 'server 2' network adapter and am fine with that as well so long as I can cut down on other manual tasks to get a better uptime and reduce manual errors.

Currently I am backing up databases and code on each box to the other, but as you can imagine restoring is a slow, manual and laborious process that is error prone.

I am looking for the ability to easily recover all settings that went with each site. For instance: SSL Certificates, IPs, physical path to the code for the site , bindings, handler mappings etc. I would hope to have all app pools restored too, just as they were on the other server with the correct framework version & pipeline mode.

As I understand it, the applicationHost.config houses most of this stuff. But if I am adding sites to a web server already running others I would assume that I couldn't replace this file since that would mean losing all of my current settings. I also am also not too keen on manually modding this file.

After looking around I found a release candidate of Microsoft's Web Deployment Tool (learn.iis.net/page.aspx/346/web-deployment-tool/). So finally, now that you have a bunch of background here comes the question:

Does anyone have any experience with quickly and (mostly) automatically adding sites to IIS 7 that is already running other sites? Has anyone done this with both "appcmd add backup" approach and [Web Deployment Tool][2] and if so what difficulties have you come up with?

Best Answer

With IIS7, it gets MUCH easier. What you're looking for is "Shared configuration". You can set that at the global level on the server. With that, you can have hot-hot, or hot-warm like you described.

On the primary server, use "export" under shared configuration. That will save the server's Machine Key (different than ASP.NET's machineKey). That ensures that all encrypted data can be ready on the new server. It will also save applicationHost.config and administration.config. Once you do an import on the 2nd server, applicationHost.config and administration.config can (and should) be 100% the same between both servers.

So, you can use DFS-R to keep the configs 100% in sync automatically, or use something like robocopy to do it at regular intervals, depending on your favorite tool.

You don't need to point to a different path on your primary server either. Just use the export for the sake of the 2nd server.

The Web Deployment Tool is great, but for what you're talking about, Shared Configuration is a better fit.

It should be noted that certificates aren't stored in those files so you need to do them manually when you set them up, or use something else (like Web Deployment Tool) for keeping those in sync.

Another thing you can consider for an inexpensive but powerful load balancer is Microsoft's new ARR technology. (Application Request Routing)