Share via


MigrationMainObj Object

Use the MigrationMainObj object to coordinate the migration from the Site Server 3.0 Membership Directory to the Commerce Server Profile data store. The MigrationMainObj object uses the following four COM objects to implement this task:

Interface

The MigrationMainObj object supports the following interface:

interface IMigrationProfile::IDispatch
{
    HRESULT Initialize(BSTR sProfileDirectory);
    HRESULT MigrateObject(BSTR bstrKeyName, long lProfile_id);
    HRESULT ShutDown();
};

Methods

The following table shows the methods of the MigrationMainObj object, and provides a descripton of each.

Method Description
Initialize Sets up all the components for the migration process. The sProfileDirectory parameter, indicating where all profile files reside, is parsed each for the following values:
  • An array containing the attribute names for each profile ID. These arrays will be stored in a structure that will be passed to the MigrationReadObj/MigrationModifyObj/MigrationWriteObj objects.

  • The connection string to the membership directory or SQL Server that will be passed to the MigrationReadObj/MigrationWriteObj objects in the form of an array of connection strings.

  • The profile ID for each profile so that the correct attribute array can be identified. The profile IDs will be passed to the MigrationReadObj and MigrationWriteObj objects in the form of an array of profile IDs. The profile ID is passed to the MigrationModifyObj object as a single ID.

  • The ProgID for each COM object so that it can be initialized with the above data. The ProgIDs will be stored in an array so that the correct objects can be called based on the profile ID.
MigrateObject Called from the Active Server Pages (ASP) page or from Microsoft Visual Basic Scripting Edition (VBscript) to migrate an ADSPath key to the Commerce stores. The profile ID to be used for this ADSPath key is passed to the object. The MigrationProfile object then finds the appropriate attribute array for this profile to be filled in by the MigrationReadObj object. This array, along with the key (ADSPath) and profile ID is then passed to the MigrationReadObj/MigrationModifyObj/MigrationWriteObj objects to be processed.
ShutDown Called from MigrationReadObj/MigrationWriteObj objects and also deallocates the data structures that were created upon initialization.

Remarks

The following structure should be added to the .IDL file to facilitate passing the profile information to each object.

typedef struct _PROFILE
    long lprofile_id;
    BSTR bstrConnection;  //bstrConfigStore in CS
    BSTR bstrCatalog;     // used in profile service initialization
    BSTR bstrMemberOf;    // migrate user's membership?
    SAFEARRAY(BSTR) Attributes;
    SAFEARRAY(USHORT) nAttributeTypes; // number of attributes types?
    SAFEARRAY(BSTR) ProfileTypes;      // only for write use
    BSTR bstrMOUserName;  // Membership User Name
    BSTR bstrMDPassword;
    BSTR bstrCSUserName
    BSTR bstrCSPassword;
    BSTR bstrADSite;      // True for ADSite, otherwise False
    BSTR bstrGroupOU;     // OU that holds all groups
    // modify info
    long lNumModifies;    // total number of modifiers in this profile
    SAFEARRAY(USHORT) rgModIndex;
} PROFILE;


All rights reserved.