Over the last few weeks, I’ve been busy upgrading my company webhosting offering from Windows 2003 / IIS 6 to Windows 2008 / IIS 7.5. We’ve been hosting sites and applications for our consultancy customers for a few years now – I think the first one went live in 2000 – so this is probably the fifth time we’ve transferred sites from one server to another. But, familiar as it is, the process is always a daunting one. I was especially nervous this time because I’m not yet as comfortable with IIS7 as I was with IIS6. There are so many details you have to get right when you’re setting up a Web site. So I was hugely relieved to come across the Web Platform Installer.
Put simply, the Web Platform Installer does all the hard work for you.
One of my big concerns was DotNetNuke. I have a number of live DotNetNuke sites, and was nervous about transferring them. It’s one thing to create a DotNetNuke installation on IIS – quite another to copy it over to another, different server and have it work and be secure.
Actually, if I were transferring from IIS 7, it wouldn’t be so difficult. I could use the (free) Web Deploy add in and export/import packages. From the documentation, I probably could have used Web Deploy to help with the transfer, even when going from IIS 6 to IIS 7… but there seems to be a lot of command line involved, and I felt there just had to be an easier way. Fortunately, there is – by combining the Web Platform Installer with that key programmer skill, copy and paste.
Put simply, the Web Platform Installer creates Web applications inside IIS 7. You can use it to create stand-alone Web sites or virtual directories for a range of standard Web applications. Once you install it, it appears as one of the options inside IIS, thus:
Here’s a close up:
If you double-click on the Web Platform Installer, it loads the latest Web Platform products:
That list might not include what you’re looking for – DotNetNuke isn’t there, for example – but you can use the search box at the top to look for other applications.
Just hit enter, and it will come back with any matches:
Now all you have to do is click Add and then Install and accept the terms and conditions. It will then download the selected application.
Once the application has downloaded, you get a 2 page wizard that allows you to create either an application under an existing Web site, or a new independent site. The first page sets up the app – the second shows the installation progress.
The end result is a fully functional Web site, set up with all the correct permissions etc.
Now the sneaky bit – replacing the new installation with your existing DotNetNuke site.
If you surf to the new site, DotNetNuke will go through its usual installation process. But that’s not what we want. We’re not looking to create a new site, but to transfer an existing site. We want to take our custom Skins and Modules, and most importantly the current database, and move them to the new server.
The first thing I did was copy over the database to the new server and make sure it was set to the correct permissions. Then I checked that the new site was assigned to the right application pool identity – in this case, Network Service as that’s what the database connection string uses.
I clicked on Set Application Pool defaults, and then changed the Identity to Network Service:
Now all I had to do was copy the files from the current site over the newly installed site, change the server name inside the Web config – and that was it: I had successfully transferred my sites. It was quick, easy and a lot less stressful than I was expecting. (It is very important to copy and paste over rather than moving the files, by the way – copying picks up the permission settings from the destination, and that’s what you want).
If you’re interested in packaging ASP.NET applications for deployment to IIS 7 using the Web Deploy add in, then we cover that in Learning Tree course Building Web Applications with ASP.NET and Ajax. If you want to know more about administering IIS 7 – then you should probably go on Internet Information Services 7.5 for Windows Server® 2008 – a course I should really get around to attending myself!