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: 



Both source and destination servers must 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.

For instructions on migrating IIS configurations for Windows 2012, please see Setting Up a Windows Server 2012 Web Farm with Web Deploy 3.0

Install the Web Farm Framework

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

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

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 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 server's 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 Add.
  • Enter the DESTINATION server's 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 Add.
  • Click Finish.

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 the destination server and select Remove Server.

© 2015 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