Powershell module including functions to report on and migrate IIS6 websites to IIS8.5


This Powershell module includes functions to report on and migrate web sites from IIS version 6 on windows 2003 servers to IIS 8.5 on Windows 2012 R2 server. There has been many improvements in Internet Information Server since version 6. With Windows 2003 end of life looming on the horizon, this module can help migrate web workloads to Windows 2012 R2.

This module can be downloaded from the Microsoft Script Center Repository. This is intended to be installed and used on the target Windows 2012 R2 server. Functions will remote into the source Windows 2003 server(s) to retrieve website files and settings. Powershell remoting on the source Windows 2003 servers needs to be configured as shown in this post.

The Migrate-WebSite function will migrate websites from IIS 6 on Server 2003 to IIS 8.5 on Server 2012 R2. The source server is left intact. No changes are done to the source Windows 2003 server. The script can be run repeatedly on the same source/target web servers. This will refresh/update files and website settings from the source server, and will over-write files/settings on the target server.

This script will handle and migrate:

  • Redirected websites
  • Websites set on other than typical port 80
  • Websites with multiple bindings
  • Virtual directories
  • HTML, classic ASP, and DotNet websites

This script will NOT migrate SSL certificates

This script is designed to run on the target 2012 R2 web server (Powershell 4). The scriptblocks that interact with Server 2003 have been tested on Powershell 2.

The script will:

  • Set NTFS permissions for NetworkService/Modify and IUSR/ReadAndExecute at the $Webroot folder
    It will update existing permissions, if any.
    I will not downgrade existing permissions
  • Copy the website files from the source server to this server.
    It will make a folder with the same name as the website name under $Webroot
    It will copy source files for all virtual folders if any existed
  • Set application pool & its properties:
    Crete application pool $AppPool if it did not exist
    Set its .NET CLR version to v2.0
    Enable 32-bit applications
    Change ‘Generate Process Model Event Log Entry’ identity to ‘Network Service’
  • Create web site, or update existing site settings
  • Add additional bindings if any existed on the source website
  • Update the website’s web.comfig file for DotNet websites
    Update any paths to reflect the new website path
    Comment out “configSections” in web.config

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s