Step-by-step guide

Document Sample
Step-by-step guide Powered By Docstoc
					                                                   th
This guide is used in the Workshop training on 22 February 2012 at OneOffice in Ghent.

Presentation can be found on: http://www.slideshare.net/orbitone



It describes the installation and migration of an existing Umbraco website to Windows Azure.




                                                Date:         22 February 2012
                                        Developed by:         Wim De Coninck
                                           Reference:
                                        Developed for:        Umbraco on Azure Workshop




Orbit One BVBA                            E-mail        info@orbitone.com
Raas van Gaverestraat 83                  Tel.          +32 9 330 15 00
B-9000 GENT, BELGIUM                      VAT           BE 456.457.353
Website www.orbitone.com                  Bank          442-7059001-50 (KBC)
 1.     Pre-requisites ______________________________________________________________ 3
 2.     Umbraco 5 – Installation _____________________________________________________ 4
        2.1.   Setup IIS to host the site ________________________________________________ 4
        2.2.   Setup the database ____________________________________________________ 5
        2.3.   Configure your Umbraco website _________________________________________ 6
 3.     Azure – Migrate the website __________________________________________________ 7
        3.1.   Database ____________________________________________________________ 7
               3.1.1.     Prepare the SQL Azure database _________________________________ 7
               3.1.2.     Migrate the local database to Azure ______________________________ 9
        3.2.   Azure Blob Storage ____________________________________________________ 12
               3.2.1.     Prepare the Azure Blob Storage _________________________________ 12
               3.2.2.     Migrate files to the Blob storage _________________________________ 13
               3.2.3.     Configuration changes _________________________________________ 14
        3.3.   Website on Azure _____________________________________________________ 15
               3.3.1.     Prepare the Azure Service Hosting _______________________________ 15
               3.3.2.     Umbraco and Azure ___________________________________________ 16
               3.3.3.     Publishing the Webrole ________________________________________ 17
 4.     Questions? ________________________________________________________________ 20
        Wim De Coninck http://twitter.com/wimdc ______________________________________ 20
        Olivier Mangelschots http://twitter.com/omangels ________________________________ 20




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                           2
 In order to successfully go through this document you will need the following pre-requisites:
      1. Visual Studio 2010 and .NET 4
      2. ASP.NET MVC 3
      3. Windows Azure SDK and Tools for Visual Studio (November 2011) version 1.6
      4. SQL Express 2008 R2


 Once you’ve installed those, let’s go get the rest:
    5. Cloudberry explorer
    6. SQL Azure Migration wizard




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                               3
 If you already have an umbraco 5 site up and running continue with Azure-Migrate the website

     1.   Download Umbraco 5 from Codeplex
     2.   Extract the files to c:\temp\UmbracoCourse\UmbracoRuntime




     1.   Start IIS (Start > Run > inetmgr)
     2.   Right click and select Add Web Site…




     3.   Give the site a name and point the Physical path to the location where you extracted Umbraco
          5 (c:\temp\UmbracoCourse\UmbracoRuntime)




     4.   Go to the Application pools section in IIS
     5.   Double click the application pool and set the .Net Framework to 4.0




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                              4
     1.   Open SQL Server Management Studio
     2.   Create a new user for Umbraco to connect




     3.   Login name: umbracouser




     4.   Click OK
     5.   Next create the database




     6.   Fill in the database name and enter umbracouser as the owner




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012       5
     1.   Browse to the site (http://localhost/)
     2.   Click to launch the wizard
     3.   Click the “Let’s get started” button
     4.   Choose the first option and fill out the boxes below as following:




     5.   Click install followed by continue
     6.   Create a user > enter a password and click “Create User”
     7.   To speed things up install the starter kit




     8.   Ready to view your website




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012             6
     1.       At the Windows Azure Platform create a new database server

                                         2




          1



     2.       Select the region closest to the target audience of the website (West Europe)




     3.       Specify a user on the server




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                            7
     4.   Add the firewall rule for the Orbit One IP range: 195.80.238.1 - 255




     5.   At this moment we don’t need to allow other Azure services to access this server. So leave the
          checkbox at the bottom unchecked.




     6.   Click Finish
     7.   Go to the newly created server and add an empty database called UmbracoWeb


                                                              2



          1




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                                8
     1.   Run SQLAzureMW
     2.   Choose Analyse / Migrate SQL Database




     3.   Click Next
     4.   Enter your server information (.\SqlExpress)
     5.   Choose to connect with a specific User ID and enter the credentials of the umbraco user




     6.   Click Connect




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                              9
     7.   Select the Umbraco database from the list and click Next




     8.   Click Next




     9.   Click Next




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012   10
        10. Click Yes




        11. When the script is generated, enter the information to connect to the SQL Azure server




        12. Select your database from the list
        13. Execute script against destination server. Select Yes




        14. Edit the web.config file located at
            C:\temp\UmbracoCourse\UmbracoRuntime\App_Data\Umbraco\HiveConfig\web.config
        15. Change the connection string to use the SQL Azure database


 TIP:
 When you select the database in the left navigation on the Windows Azure Platform, you can find the
 connection string in the properties pane (right). Take the one for ADO.Net.


 Now we can browse to the site again at http://localhost. If you changed the configuration and still get
 the website, not the first screen with the launch wizard button from Umbraco, the migration was
 successful.




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                                11
         1.   Go to the Windows Azure Platform
         2.   Create a New Storage account

    3
    2
     1




    1
                                        2
                                         1




                                        11


         3.   Enter a valid name for your storage account
         4.   Choose a region closest to the target audience of the site (West Europe)




         5.   Click OK




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                       12
     1.    Run CloudBerry Explorer for Azure Blob Storage
     2.    Go to File > Azure Blob Storage Accounts
     3.    Click the Add button
     4.    Enter the information needed:
                 Display name: any name you want
                 Account: the name of your storage account
                 Shared Key: the Primary Access Key (found in Windows Azure Portal)




     5.    Navigate to the Azure Blob Storage with the Explorer on the right hand side
     6.    Create a new Container




     7.    Enter the name: media
     8.    Select Full public read access
     9.    Click Ok
     10.   Repeat step 7 through 9 for “relations”, “css” and “scripts”
     11.   At the left hand side of the screen in the Explorer open your website at
           C:\temp\UmbracoCourse\UmbracoRuntime
     12.   Copy the folders from Content\Media to the media container (except relations)
     13.   Copy the files from Content\Media\Relations to the relations container
     14.   Copy the files from Scripts to the scripts container
     15.   Copy the files from Content\Styles to the css container




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                         13
     1.   Open the web.config file located at C:\temp\UmbracoCourse\UmbracoRuntime
     2.   In the <sectionGroup name="fileSystemProviderSettings"> change the settings for file-
          uploader, stylesheets and scripts to read:
          <section name="file-uploader"
                  type="Umbraco.Hive.Providers.IO.Blob.ConfigSection,
                  Umbraco.Hive.Providers.IO.Blob" requirePermission="false" />
          <section name="stylesheets"
                  type="Umbraco.Hive.Providers.IO.Blob.ConfigSection,
                  Umbraco.Hive.Providers.IO.Blob" requirePermission="false" />
          <section name="scripts" type="Umbraco.Hive.Providers.IO.Blob.ConfigSection,
                  Umbraco.Hive.Providers.IO.Blob" requirePermission="false" />
     3.   In the section <umbraco> <fileSystemProviderSettings> change the settings for file-
          uploader, stylesheets and scripts to read:
          <file-uploader supportedExtensions="*.jpg;*.gif;*.pdf;*.docx"
                container="media" rootPublicDomain=""
                connectionString="DefaultEndpointsProtocol=https;AccountName=accountName
                ;AccountKey=yourAccountKey" />
          <stylesheets supportedExtensions="*.css" container="css" rootPublicDomain=""
                connectionString="DefaultEndpointsProtocol=https;AccountName=accountName
                ;AccountKey=yourAccountKey" />
          <scripts supportedExtensions="*.js" container="scripts" rootPublicDomain=""
                connectionString="DefaultEndpointsProtocol=https;AccountName=accountName
                ;AccountKey=yourAccountKey" />
        Change the accountName to your Azure Storage account name and change the
        yourAccountKey to your Primary Access Key
     4. Open the hive configuration from C:\temp\UmbracoCourse\UmbracoRuntime\App_Data\
        Umbraco\Config\umbraco.hive.config
     5. Change the following application settings for file-uploader, scripts and stylesheets:
        <add key="file-uploader"
                type="Umbraco.Hive.Providers.IO.Blob.EntityRepositoryFactory,
                Umbraco.Hive.Providers.IO.Blob "
                providerConfig="umbraco/fileSystemProviderSettings/file-uploader" />
          <add key="scripts"
                type="Umbraco.Hive.Providers.IO.Blob.EntityRepositoryFactory,
                Umbraco.Hive.Providers.IO.Blob "
                providerConfig="umbraco/fileSystemProviderSettings/scripts" />
          <add key="stylesheets"
                type="Umbraco.Hive.Providers.IO.Blob.EntityRepositoryFactory,
                Umbraco.Hive.Providers.IO.Blob"
                providerConfig="umbraco/fileSystemProviderSettings/stylesheets" />

 Remark:
 In order to make the configuration work you need to update Umbraco. The hive provider for Windows
 Azure Blob Storage is so new that some (minor) changes have been made to both the packages as the
 bin files in your current Umbraco installation (v5)

     1.   Download the files from the Codeplex project (compiled version).
          If you are interested in the source it can be found at:
          https://hg01.codeplex.com/forks/sitereactor/azurehive (from Morten Christensen)
     2.   Copy/paste the bin folder over your bin folder at C:\temp\UmbracoCourse\UmbracoRuntime
     3.   Copy/paste the App_Plugins folder over your App_Plugins folder at
          C:\temp\UmbracoCourse\UmbracoRuntime
     4.   Now you can browse to the site again to check if everything is still working. (http://localhost)




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                                 14
     1.   Go to the Windows Azure Platform
     2.   Select Hosted Services,Storage Accounts & CDN
     3.   Click on New Hosted Service




     4.   Give your Hosted service a name
     5.   Select the Region closest to the target audience of the website (West-Europe)
     6.   For deployment options choose Do not deploy




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                        15
 By default ClientDependency stores files in a local directory (/App_Data/ClientDependency) which
 doesn't play so well with Azure and multiple instances.
 The updated config file takes the distribution of installs/instances into account and resolves js, css etc
 from paths relative to the current instance.
 The config file can be found at
 "C:\temp\UmbracoCourse\UmbracoRuntime\App_Data\Umbraco\Config\ClientDependency.config"
 Replace it with the following:
 <?xml version="1.0"?>
 <clientDependency version="30">
   <mvc defaultRenderer="StandardRenderer">
     <renderers>
       <add name="StandardRenderer"
 type="ClientDependency.Core.FileRegistration.Providers.StandardRenderer,
 ClientDependency.Core" enableCompositeFiles="false"/>
     </renderers>
   </mvc>
   <compositeFiles defaultFileProcessingProvider="CompositeFileProcessor"
 compositeFileHandlerPath="~/DependencyHandler.axd">
     <fileProcessingProviders>
       <add name="CompositeFileProcessor"

 type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvi
 der, ClientDependency.Core"
            enableCssMinify="false"
            enableJsMinify="false"
            persistFiles="true"
            compositeFilePath="~/App_Data/ClientDependency"
            urlType="MappedId"/>
     </fileProcessingProviders>
   </compositeFiles>
 </clientDependency>




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                                   16
     1.   Open Visual Studio 2010
     2.   Create a new Project
     3.   Select Cloud in the left navigation and Windows Azure Project
     4.   Browse to c:\temp\UmbracoCourse




     5.   Select the ASP.NET MVC 3 Web Role




     6.   Click OK




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012        17
     7.    Select Empty




     8.    Click OK
     9.    Open ServiceDefinition.csdef in the UmbracoDeployment Project
     10.   Change the vmSize to ExtraSmall
     11.   Change the site name to UmbracoSite
     12.   Add a physicalDirectory to the element with ..\UmbracoRuntime for the value
           <Site name="UmbracoSite" physicalDirectory="..\UmbracoRuntime">
     13. In the project properties of MvcWebRole1 you need to add a post build script




     xcopy   /y   "$(TargetDir)*.*" "$(SolutionDir)UmbracoRuntime\bin\"
     xcopy   /y   /e "$(ProjectDir)Content\*.*" "$(SolutionDir)UmbracoRuntime\Content\"
     xcopy   /y   /e "$(ProjectDir)Scripts\*.*" "$(SolutionDir)UmbracoRuntime\Scripts\"
     xcopy   /y   /e "$(ProjectDir)Views\*.*" "$(SolutionDir)UmbracoRuntime\Views\"




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012                       18
     14. Right click the Umbraco Deployment project and select Publish




     15. Click Next and publish (this could take several minutes.

 Remark
 If you need help setting up your hosted service credentials:
          http://msdn.microsoft.com/en-us/library/windowsazure/ff683676.aspx




              Your Umbraco 5 website is now fully hosted on Windows Azure !




Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012             19
Umbraco on Azure Workshop
Umbraco 5 on Windows Azure - Step-by-step guide - 22 February 2012   20

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:65
posted:6/25/2012
language:English
pages:20