Upgrading Windows Azure Pack: Web Sites from Preview Versions

This topic provides scripts and commands that you can use to upgrade a supported preview version of Windows Azure Pack: Web Sites to the R2 release version. For information on upgrading Windows Azure Pack itself, see Upgrade from the Preview version of Windows Azure Pack.

 

When upgrading Windows Azure Pack: Web Sites from a preview version, keep in mind the following:

·      You must start the upgrade from the Web Sites controller.

·      The Web Sites roles can be upgraded at the default rate of 5% of servers per server farm, or you can specify a different percentage.

·      If you are upgrading from the V2 preview to the R2 release, you must also execute a set of SQL commands against the hosting database.

Warning

The Web Sites Controller will be fully functional only after the new Windows Azure Pack: Web Sites version is installed and the databases are upgraded.  Until the database upgrade, the controller will be in an unusable state because the web farm service cannot be started.

Start the Upgrade

On the Web Sites controller, perform the following steps.

1.   At an elevated command prompt, optionally stop the web farm service. This step eliminates the need to restart the controller after installation:

net stop webfarmservice

2.   Although the installing the new version will automatically uninstall the old version, you can manually uninstall the old version first if you want. To uninstall the previous version manually, go to Control Panel > Programs and Features, and uninstall Web Hosting Framework.

3.   Using the Web Platform Installer, install the new version of Windows Azure Pack: Web Sites. For more information, see Start the installation of Windows Azure Pack: Web Sites.

You can upgrade the Windows Azure Pack: Web Sites roles at the default rate of 5% of servers per server farm, or in a controlled fashion.

To upgrade 5% of the servers per server farm at a time

On the controller, run the following PowerShell script to upgrade the database, set the feedUrl in the hostingConfiguration and start the upgrade on all roles. Change the database server name and password information as required by your environment.

"%ProgramFiles%\IIS\Microsoft Web Sites\Feed\WebSitesSetupHelper.ps1" -actions CompleteUpgrade -upgradeConnectionString "Server=DB-Websites;User Id=sa;Password=password"

 

Note

·      The -upgradeConnectionString parameter is required only to upgrade V1 to the R2 release (it is not require to upgrade V2 Preview to the R2 release).

·      The connection string must use sa credentials.

To upgrade Windows Azure Pack: Web Sites servers at a specified rate:

1.   Run the following command to upgrade the database and set the new feed URL in the hosting configuration:

"%ProgramFiles%\IIS\Microsoft Web Sites\Feed\WebSitesSetupHelper.ps1" -actions CompleteUpgrade -skipRoleUpgrade

2.   Use the following PowerShell commands to control the rate at which the roles are upgraded. Set the value for WFFMaximumStoppedServersPercentage to the percentage of servers per server farm that you want to upgrade at a time. The default is 5%.

Add-pssnapin WebHostingSnapin

Set-WebSitesConfig -Type Global -WffMaxStoppedServersPercent <percentage>

Example

The following example upgrades 20% of the servers in each server farm at a time.

Set-WebSitesConfig -Type Global -WffMaxStoppedServersPercent 20

Initiate the role upgrade for all Windows Azure Pack: Web Sites roles, or on a per-role basis

1.   To initiate the upgrade for all Web Sites roles, run the following PowerShell command:

"%ProgramFiles%\IIS\Microsoft Web Sites\Feed\WebSitesSetupHelper.ps1" -actions 'UpgradeAllServers'

2.   To initiate the upgrade of Web Sites roles on a per-role basis, you can run each of these PowerShell commands separately:

Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="FrontEndServers"}

 

    Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="FileServers"}

 

    Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="ManagementServers"}

 

    Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="PublisherServers"}

 

    Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="WorkerServers"}

When upgrading from V2 Preview to the R2 release

When upgrading from V2 Preview to the R2 release (but not from V1 to the R2 release), you must also run the following SQL commands against the "Hosting" database. These commands enable support to update existing subscriptions and plans after the upgrade.

-- Get the ResourceId for the 'CpuTime' resource.

DECLARE @CpuTimeResourceId INT;

SELECT @CpuTimeResourceId = (SELECT TOP 1 ResourceId FROM runtime.QuotaResources WHERE ResourceName = N'CpuTime')

 

INSERT  INTO [runtime].[OwnerQuotas]

                ([QuotaName],

                 [PolicyId],

                 [ResourceId],

                 [Limit],

                 [ExceededAction],

                 [TimeUnits],

                 [Period],

                 [ActionId])

SELECT 'CpuTimeBurst', POL.PolicyID, @CpuTimeResourceId, -1, 0, 1, 5, NULL

FROM [admin].[subscriptions] SUB

INNER JOIN [runtime].[SitePolicies] POL

ON SUB.Name = POL.PlanName

WHERE NOT EXISTS (SELECT 1 FROM runtime.OwnerQuotas O WHERE O.PolicyId = POL.PolicyID AND QuotaName = N'CpuTimeBurst')

  

INSERT  INTO [runtime].[SiteQuotas]

                ([QuotaName],

                 [PolicyId],

                 [ResourceId],

                 [Limit],

                 [ExceededAction],

                 [TimeUnits],

                 [Period],

                 [ActionId])

SELECT 'CpuTimeBurst', POL.PolicyID, @CpuTimeResourceId, -1, 0, 1, 5, NULL

FROM [admin].[subscriptions] SUB

INNER JOIN [runtime].[SitePolicies] POL

ON SUB.Name = POL. PlanName

WHERE NOT EXISTS (SELECT 1 FROM runtime.SiteQuotas O WHERE O.PolicyId = POL.PolicyID AND QuotaName = N'CpuTimeBurst')

See Also

Upgrade from the Preview version of Windows Azure Pack

Deploy Windows Azure Pack: Web Sites