Page tree
Skip to end of metadata
Go to start of metadata

Overview

By default, the object of each Translation Script is a single migration unit: a VBP or an ASP page; and it produces a single .NET project (csproj or vbproj) as output. This is appropriate for VBPs. However, when you are migrating a web site you will want to create a multi-unit Translation Script that directs the conversion of all the top-level pages that make up the site. Translating this script will produce a single web application project that can be used to direct the build of the entire web site. The benefits of web application projects are described on MSDN.

Web Script Setup

The procedure for doing creating a Multi-unit script for a web site is described here:

  1. Set the Content Type for all files in the web migration project
    (a) Press CTRL-A
    (b) Click [Tools/Set Build Order] from the menu
     
  2. Filter the task list to display only Page files.
    (a) Click [Filter] on the Toolbar
    (b) Enter "PAGE" in the BLDTYP field (without quotes)
    (c) Click Save
     
  3. Select all Page files.
    Press CTRL-A
     
  4. Generate a Multi-unit script for the Page files.
    Click [Reports/Multi-Unit Script] from the menu
The process above will do several things:
  • Create a web site migration script and place it in the workspace\usr folder  
  • Add an web site translation task to your migration project with name = "ALLJOBS"  
  • Display the new script in the text editor.

You can optimize your site script by adding registry commands, reference commands, or other refactoring directives.For example, the listing below is the multi-unit script for the DemoFMSweb_csh sample. This script was created by gmStudio then the following sections were manually added:

  • Lines 30-33: References to the COM DLLs used by the site. Note that these are actually references to the IDFs generated when the DemoFMSLib_csh migration project is translated.
     
  • Lines 36-38: A one-off migration rule to instruct the system that ADODB.Field may contain DBNull and needs special handling.
     
  • Lines 77-172: Various target edits to clean up the csproj file and make it easier to work with. Alternatively, these edits could be made the default for all migrations by modifying the system configuration files RUNTIME.XML if desired.

     

<gmBasic>
<Storage Action="Create" Identifier="%JobId%"/>

   <!-- Translation Options -->
   <Select progress="1"/>
   <Select Dialect="%Dialect%"/>
   <Select CheckUUIDS="off"/>
   <Select AuthorLibrary="off"/>
   <Select NullOrEmpty="On"/>
   <Select SingleQuotes="On"/>
   <Select DevEnv="%DevEnv%" />

   <!-- Environmental Information -->
   <select VirtualRoot="%VirtualRoot%" />
   <select DeployLocation="%NetProjFolder%" />
   <select Library="%InteropFolder%" />

   <!-- C# Web Application Project GUIDS -->
   <Registry type="guid" source="Project" target="{7EE74E01-07B7-4C4F-B053-895BB67A3A51}" />
   <Registry type="guid" source="ProjectType1" target="{349c5851-65df-11da-9384-00065b846f21}" />
   <Registry type="guid" source="ProjectType2" target="{fae04ec0-301f-11d3-bf4b-00c04f79efbc}" />
   <Registry type="guid" source="Flavor" target="{349c5851-65df-11da-9384-00065b846f21}" />

   <!-- Config search Paths -->
   <Select Target="%UserFolder%" />
   <Select Local="%IdfFromCodeFolder%" />
   <Select System="%IdfFromIdlFolder%" />

   <!-- COM References -->
   <Reference id="FMStocks_DB.dll"/>
   <Reference id="FMStocks_Bus.dll"/>
   <Reference id="FMSStore_Bus.dll"/>
   <Reference id="FMStocks_Ext.dll"/>

   <!-- One-off migration rules -->
   <Refactor id="[msado27.tlb]" >
      <Migrate id="Field20.Value" CanBeNull="on" />
   </Refactor>

   <!-- Compile the site -->
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\_about.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\_GetXMLPortfolio.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\_GetXMLTickerHistory.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\_NewAccount.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\_runsql.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\_version.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\401k.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\AccountSummary.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\browse.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\BuyStock.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\cart.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\ChartPortfolio.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\checkout.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\default.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\FindProduct.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\Home.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\Logout.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\news.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\OfflinePortfolio.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\Portfolio.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\SellStock.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\SellStockAction.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\SellStockReceipt.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\store.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\template.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\TickerDetail.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\TickerList.asp" />
   <Compile PageSlice="C:\gms\samples\source\FMStocks\FMSWeb\ASP\ViewProduct.asp" />

   <!-- Apply Migration Rules -->
   <Analyse/>

   <!-- Apply final edits and author the migration  -->
   <Output  Status="New" Filename="%BndPath%"/>
   <Author name="%MigName%">

   <Fix host="WebProjectFile">

   <Replace name="Upgrade: Add AspNetCompilerTask to the project to allow verify by build">
      <OldBlock><![CDATA[
         <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
            Other similar extension points exist, see Microsoft.Common.targets.
         <Target Name="BeforeBuild">
         </Target>
         <Target Name="AfterBuild">
         </Target>
         -->
      ]]></OldBlock>
      <NewBlock><![CDATA[
         <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
            Other similar extension points exist, see Microsoft.Common.targets.
         <Target Name="BeforeBuild">
         </Target>
         <Target Name="AfterBuild">
         </Target>
         -->
         <Target Name="AfterBuild">
              <AspNetCompiler
                  VirtualPath="/%MigName%"
                  PhysicalPath="%NetProjFolder%"
                  TargetPath="%NetProjFolder%_build"
                  Force="true"
                  Debug="true"
              />
         </Target>
      ]]></NewBlock>
   </Replace>

   <Replace name="C: Cleanup unused references">
   <OldBlock><![CDATA[
      <Reference Include="System" />
      <Reference Include="System.Data" />
      <Reference Include="System.Drawing" />
      <Reference Include="System.Web" />
      <Reference Include="System.Xml" />
      <Reference Include="System.Configuration" />
      <Reference Include="System.Web.Services" />
      <Reference Include="System.EnterpriseServices" />
      <Reference Include="System.Web.Mobile" />
      <Reference Include="Microsoft.VisualBasic" />
      <Reference Include="System.Windows.Forms"/>
   </ItemGroup>
   <ItemGroup>
      <Import Include="Microsoft.VisualBasic" />
      <Import Include="Microsoft.VisualBasic.CompilerServices" />
      <Import Include="System" />
      <Import Include="System.Collections" />
      <Import Include="System.Data" />
      <Import Include="System.Diagnostics" />
      <Import Include="System.Drawing" />
      <Import Include="System.Windows.Forms" />
   </ItemGroup>
   ]]></OldBlock>
   <NewBlock><![CDATA[
       <Reference Include="System" />
       <Reference Include="System.Web" />
       <Reference Include="Microsoft.VisualBasic" />
       <Reference Include="System.Windows.Forms"/>
     </ItemGroup>
     <ItemGroup>
       <Import Include="Microsoft.VisualBasic" />
       <Import Include="Microsoft.VisualBasic.CompilerServices" />
       <Import Include="System" />
       <Import Include="System.Collections" />
       <Import Include="System.Diagnostics" />
       <Import Include="System.Windows.Forms" />
     </ItemGroup>
   ]]></NewBlock>
   </Replace>

   <Replace name="U: Set virtual root for IDE">
   <OldBlock><![CDATA[<DevelopmentServerVPath>/</DevelopmentServerVPath>]]></OldBlock>
   <NewBlock><![CDATA[<DevelopmentServerVPath>/%MigName%/</DevelopmentServerVPath>]]></NewBlock>
   </Replace>

   </Fix>

   <Fix name="fixes to pages/code">

      <Replace name="C: Cleanup unused references">
      <OldBlock><![CDATA[
      using System;
      using System.Data;
      using System.Configuration;
      ]]></OldBlock>
      <NewBlock><![CDATA[
      using System;
      using System.Configuration;
      ]]></NewBlock>
      </Replace>

   </Fix>
   </Author>

<Storage Action="Close"/>
</gmBasic>

 

 

  • No labels

4 Comments

  1. Anonymous

    when i am migrating my project using ALLJOBS.XML its showing me some error ,

    Starting Batch...
    TASKS: Run Translation,Deploy Translation,Build Translation,
    Run Translation
    ...
    LastMsg = TRANSLATE: SUCCESS; 2015-09-01 17:56:11
    TrnStat = SUCCESS
    NetSize = 255
    Deploy Translation
    Deploying: D:\GMStudio demos\all jobs one scripts\log\alljobinone-ALLJOBS-std-csh.bnd
    ...
    LastMsg = DEPLOY: FAIL; 2015-09-01 17:56:12
    Build Translation
    Building: D:\GMStudio demos\all jobs one scripts\deploy\ALLJOBS.csproj
    ...
    Build FAILED.
    "D:\GMStudio demos\all jobs one scripts\deploy\alljobinone.csproj" (Rebuild target) (1) ->
    (CoreCompile target) ->
    CSC : error CS2001: Source file 'D:\GMStudio demos\all jobs one scripts\usr\tran.aspx.cs' could not be found [D:\GMStudio demos\all jobs one scripts\deploy\alljobinone.csproj]
    CSC : error CS2001: Source file 'One\FirstPage.aspx.cs' could not be found [D:\GMStudio demos\all jobs one scripts\deploy\alljobinone.csproj]
    0 Warning(s)
    2 Error(s)
    Time Elapsed 00:00:00.66
    LastMsg = .NET BUILD: 2 Error(s); 0 Warning(s); 2015-09-01 17:56:17
    NetBlds = FAIL
    Batch Complete. Elapsed Time= 00:00:06.168

     

    1. I suspect your deployment failed, probably because the deploy folder did not have the subfolders required.  Setting up the deploy folder structure is typically done using a user batch command file associated with the site upgrade task in your upgrade project.  An example of this is found in the fmStocks sample.  Here it is in the userCmd.FMSweb.cmd script:

      ...
      ::----------------------------------------------------------------
      :PRE-DEPLOY
      ::----------------------------------------------------------------
      echo USER COMMAND: %1 [%JobId%]
      :: Enter pre-deployment processing here (e.g. file replacement)
      
      echo setup directory folders for site
      robocopy "%VirtualRoot%" "%ProjFolder%\deploy\web" * /s /xf * /e
      echo deleting *.as* files from deployment %ProjFolder%\deploy
      if exist "%ProjFolder%\deploy\web\*.as*" del /s "%ProjFolder%\deploy\web\*.as*"
      if exist "%ProjFolder%\deploy\web\*.cs*" del /s "%ProjFolder%\deploy\web\*.cs*"
      goto END
      ...
      Note: the script clears out the deploy folder of source files so that single page upgrades do not interfere with each other.  

      See the topic "Where are my aspx files..." in Deployment 

      More on user batch processing is here: Batch Command Script

       

  2. Anonymous

    Unable to create: \\Usercontrol demo\deploy\D:\GMStudio demos\Usercontrol demo\usr\tran.aspx.cs
    Creating Directory: \\Usercontrol demo\deploy\D:\GMStudio demos\Usercontrol demo\usr\
    Unable to create: \\Usercontrol demo\deploy\D:\GMStudio demos\Usercontrol demo\usr\tran.aspx.cs
    LastMsg = DEPLOY: FAIL; 2015-09-02 

     

    Still i am getting this error.

    its trying to create tran.aspx.cs file in usr folder but its unable to create it.

    Please give me any solution foe this.

    1. It looks like there is a mismatch in the VirtualRoot setting (UNC path) in the project file and the source folder specified for the page (D:\ ).  This is preventing the tool from computing the deployment path correctly.  I will follow up with you directly.