Windows 2008 IIS and Database Migration using the Web Farm Framework


The following article will document the process used to perform an application level migration of the IIS 7.X running configuration, MSSQL and all associated data to another server. Please note that some elements like custom .DLLs and third party modules may need to be migrated manually. Let's take a look at how to perform this:

Contents:

Requirements

Both source and destination servers should be running Windows 2008. The revision level is not as important. The destination server size is not important so long as it has enough free space to hold all the custom data.

Install the Web Farm Framework

Install the Microsoft Web Platform installer on both the source and destination servers. Here is the link to the Web Platform Installer 3.0: http://www.microsoft.com/web/downloads/v3/platform.aspx

Install the Microsoft Web Farm Framework v2.2 available here: http://www.iis.net/download/webfarmframework

Configure the Windows Firewall

The Windows Firewall on both the source and destination servers will need to be properly configured in order to allow communication between both instances of IIS. This can be done by either setting up an admin IP on both servers, or by opening up specific ports.

Run the following command from the command line:

netsh advfirewall firewall add rule name="Web Farm" dir=in action=allow remoteip ="IPADDRESS" enable=yes

You will need to run this rule once on each server replacing the word IPADDRESS with the correct IP address of the REMOTE server. Optionally, you could open up the SMB, Remote Administration (RPC), and Web Farm Agentservice (8172 and 8173) ports on both servers instead of creating the Admin IPs.

Configure the Web Farm Service

You will need to create an administrative account on both servers that will be used by the Web Farm Framework to synchronize the configuration settings and data between servers. 

  • Run the following commands from a command prompt to create the accounts and add them to the administrators group. You will need to replace the word PASSWORD with something valid:
Net user webfarmuser PASSWORD /add
Net localgroup administrators webfarmuser /add
  • Launch the IIS Manager.
  • Expand out the Server Node.
  • Right click on the Server Farms Node and select the Create Server Farm option.
  • Enter the Server Farm name in the appropriate field.
  • Check the box labeled Provision Server Farm.
  • Enter the authentication credentials that were created earlier into the Server Farm Administrator section.
  • Click Next.
  • Enter the SOURCE servers IP address or Server Name in the appropriate field. This can be the private IP if both servers are in the same Data Center.
  • Uncheck the box in front of “Server is available for load balancing".
  • Check the box labeled “Primary Server”.
  • Click the Add button.
  • Enter the DESTINATION servers IP address or Server Name in the appropriate field. This can be the private IP if both servers are in the same Data Center.
  • Check the box labeled “Server is available for load balancing.
  • Click on the Add button.
  • Click the finish button.

The server farm framework will now begin copying over all of the IIS configuration settings, data, and SSL certificates over to the destination server. You can view the progress by doing the following:

  1. From within IIS, expand out the Server Farms Node. Expand out the Farm Node.

Note: The name will vary depending on what you named it during the creation process.

  1. Next, select Servers and you'll be able to see the current actions listed in the Trace Messages section.
  2. The destination server should have received all of the IIS data when the Secondary shows Yes under the Ready For Load column.

Migrating SQL using the Web Farm Framework

There are numerous methods of migrating MSSQL databases over to the destination server and what method you select should be decided upon by you and your developers based on your unique needs. In addition to the traditional methods of migrating databases, you can also use MSDEPLOY which was installed during the installation, and is a key component, of the Web Farm Framework. Here are the steps you can follow if you want to use MSDEPLOY to migrate your databases:

Bring up the MSDEPLOY command console on the SOURCE server by performing the following:

  1. Start
  2. IIS 7.0 Extensions
  3. Web Deploy Command Line and the modify the following line to match your environment and then paste it into the MS deploy command prompt (The private IP can be used if both servers are in the same Data Center): 
msdeploy.exe -verb:sync -source:dbFullSql="Data Source=SOURCEIPADDRESS;User Id=USERNAME;password=PASSWORD;Initial Catalog=DBTOBEMOVED" -dest:dbFullSql="Data Source=DESTIPADDRESS;User Id=USERNAME;password=PASSWORD;initial catalog=DBTOBEMOVED;" 

Removing the Destination Server from the Web Farm Service

It is not necessary to remove the Web Farm Framework once the migration has been completed, but the individual servers can be removed by doing the following: 

  1. From within IIS, expand out the Server Farms Node.
  2. Expand out the Farm Node and the select Servers.

Note: The name will vary depending on what you named it during the creation process.

  1. Right click on the destination server and select Remove Server.


Was this content helpful?




© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER