How-to migrate Umbraco 4.0 to IIS 7 and asp.net 3.5

Tuesday, April 07, 2009 by Administrator

Last night umbraco.org was migrated from our tired old windows 2003 server to a new windows 2008 monster server. This meant we had the opportunity to migrate to a asp.net 3.5 setup with integrated pipe-lines using IIS 7. It can seem like a daunting task, but in reality it is a simple operation. This is the walkthrough of how we moved umbraco.org.

Files and database

To make the transfer as fluent as possible we setup a new site next to the old one, and copied over all the files. We backed-up the database, but otherwise kept it where it was, as it was already upgraded to 4.0 and no changes are needed for the database. So we now had two identical sites: www.umbraco.org running asp.net 2.0 which point at the umbraco4Db database, and new.umbraco.org pointing at that same database. The files on both sites are identical at this point.

Websites and application pools

For the new site, we setup a new website in IIS7, and a separate Application Pool, setting it to framework asp.net 2.0 and using integrated pipeline.
(note: asp.net 3.5 is an extension of 2.0 so it has no separate framework settings)

Configuration files

Despite its complexity, umbraco.org is still an unmodified umbraco installation. So the only configuration file we needed to change was the web.config, if you have a more custom setup, your results might vary.

To upgrade the web.config to an asp.net 3.5 compatible version, go to the umbraco source repository and open aspnet35.config, which is located here:

http://umbraco.codeplex.com/SourceControl/changeset/view/48966#742920

Use this file as a base for your new web.config, copy over custom configuration from the old web.config, such as custom sections, umbracoDbDNS and other custom appsettings, the MemberShipProvider sections, RoleProvider settings etc.

Especially notice if umbracoMembershipProvider (under membership) has a passwordformat ="hashed", this differs between version 4.0 and 4.0.1.

When you've synced the changes between your old web.config and the file from the codeplex repository, you have an asp.net 3.5 compatible configuration file which can run on integrated pipeline. This new web.config file is placed in the root of the new website and testing can begin.

Directory urls and authentication

if you use extensionless urls / directory urls with umbraco as well as authenticating users on your website, you need to add one additional setting to the web.config.

under <system.webserver> all umbaco's httpmodules are listed. Due to the way IIS process extensionless urls, you need to add: runAllManagedModulesForAllRequests="True" to the modules element, så it looks like this: <modules runAllManagedModulesForAllRequests="True">

That is all there is to it, copy over files, keep database connection, upgrade web.config file to a asp.net 3.5 compatible version, and you're done.

Things to keep in mind

Make sure that your folder permissions on the new site are setup to work with IIS 7 and your application pool.

Don't do this upgrade on a live site, backup your files and migrate it to a new website, when the migration is done, it is very easy to simple turn off the old site and change the hostnames on IIS7.

You don't need a new database, as no database changes are needed to switch to IIS7 and asp.net 3.5

4 comment(s) for “How-to migrate Umbraco 4.0 to IIS 7 and asp.net 3.5”

  1. Gravatar ImageVarun Maggo Says:

    Thanks it helped!

  2. Gravatar ImageJacob Says:

    The link to web.config is dead ?

  3. Gravatar ImageTim Says:

    The link to the new web.config file is dead!?
    Please update to the new one, thanks.

  4. Gravatar ImageChen Says:

    Please update the download link, thanks!

Leave a comment