Migration Changes for Extended Orders Systems

If you extend the Orders System, you must change the OrderMigrationMappings.xml file and the CS2007Upgrade.exe.config files. Both files are located at %Commerce_Server_Root%\Upgrade. It is assumed that you have already updated the OrderObjectMappping.xml file.

The following list outlines the changes that must be made:

  • Update the OrderMigrationMappings.xml file to include any new pipeline mappings.

  • Update the CS2007Upgrade.exe.config to include the following:

    • Add a new StorageMappingFilename attribute.

    • Add new types to the Types section.

  • Update the order mapping SQL file by using the static SQL tables.

This topic describes how to make these changes.

Update the OrderMigrationMappings.xml File

The OrderMigrationMappings.xml file is a modified version of the OrderPipelineMappings.xml file. It contains mappings of properties from Commerce Server 2000 and Commerce Server 2002 to those of Commerce Server 2007, and is used only for migration to Commerce Server 2007. Add a mapping for each non-collection Orders Runtime Object property to the OrderGroupClass node located at the end of the file. This mapping will not affect the pipeline components.

The following code shows the OrderGroupClass node from the default OrderMigrationMappings.xml file.

<OrderGroupClass Name="OrderGroup">
    <Property Name="TrackingNumber" DictionaryKey="order_number" />
    <Property Name="Name" DictionaryKey="saved_order_name" />
    <Property Name="Created" DictionaryKey="d_DateCreated" />
    <Property Name="BillingCurrency" DictionaryKey="billing_currency" />
    <Property Name="LineItemCount" DictionaryKey="total_lineItems" />
    <Property Name="ModifiedBy" DictionaryKey="g_UserIDChangedBy" />
    <Property Name="LastModified" DictionaryKey="d_DateLastChanged" />
    <Property Name="SoldToId" DictionaryKey="user_id" />
    <Property Name="OrderGroupId" DictionaryKey="ordergroup_id" />
</OrderGroupClass>

As shown in the previous code, the DictionaryKey attribute references the old property name, and the Name attribute references the new property name.

Update the CS2007Upgrade.exe.config File

The CS007Upgrade.exe.config file specifies information about the types that are used in the orders system, and also contains pointers to mapping files. When you extend the Orders System, this file must be updated with new type data. If the default OrderObjectMappings.xml file is renamed, add a pointer to the new file by using the StorageMappingFilename attribute. Be aware that if this attribute is not added, the default OrderMigrationMappings.xml file will be used.

Update the CS2007Upgrade.exe.config as follows:

  • Add a new StorageMappingFilename attribute to the MappingFiles node, pointing to the updated OrderMigrationMappings.xml file.

    <MappingFiles PipelineMappingFilename="OrderMigrationMappings.xml" StorageMappingFilename="MyOrderObjectMappings.xml"/>
    
  • Update the Types node with a new Type node for each new type. The following code shows a Type node from the default file.

    <Types>
        <Type
            Key="Basket"
            UserTypeName="Basket"
            AssemblyType="GAC"
            NameSpace="Microsoft.CommerceServer.Runtime.Orders"
            Assembly="Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        />
    

Update the Order Mapping SQL File

To update the order mapping SQL file

  1. Locate <drive>:\Program Files\Microsoft Commerce Server 2007\Sdk\Samples\SiteCreate.

  2. Using a text editor, open Requisition.sql.

  3. Search for the following code:

    Requisition_Static.sql
    
  4. Select everything from the start of the comment block to the end of the file and copy it to the Clipboard.

  5. Open your order mapping SQL file that was created by using the Order Mapping Tool, and paste the text from Requisition.sql into the end of the file.

Note

When these changes are made, the OrderTemplatesAndBaskets table will be dropped and recreated, and all the stored procedures related to Basket and Order templates will be regenerated. If you have customized these tables, you can edit or remove the associated SQL statements to prevent the tables from being overwritten.