As we were doing our upgrade we realized early on that we did not want to keep the SSP as it was migrated during the upgrade process. The upgraded version just locked us into to many things that we didn’t like. As a result we decided that we would delete the upgraded SSP and create a new one. This meant that I had to find a way to get any custom profile properties that were created in SPS 2003 as well as any user provided data over to MOSS. In my particular situation I didn’t have to worry about creating new profiles – we were going to set up a profile import, let the import occur, and then adjust the profiles – so the tool I created uses a map file to figure out which properties to create and which data to copy over.

The tool first creates any missing properties and then loops through all users in the old system and sets the data in the new system. One of my requirements was to be able to get the SPS 2003 profile data without relying on the SPS 2003 server to still be running – as a result I chose to grab the data directly from the database (note that I am currently not handling Multi-Value properties as my system didn’t have any that I needed to migrate so I chose to ignore them – though I can handle setting multi-value properties, just not reading them). In order to pull this off I needed two STSADM commands – one to generate the xml map file, gl-gen2003to2007profilepropertymap, and the other, gl-migrate2003profilesto2007, to consume that map file and do the actual migration. I discuss each of them below.

gl-gen2003to2007profilepropertymap

Before you can use the migration command you have to generate a mapping file. In order to assist with this I created this command. The resultant xml file contains reference nodes showing all the current MOSS 2007 properties and their settings. It also shows all the properties from your 2003 database. If the tool can find a matching column in MOSS then it will add minimal details. If it cannot find a match then it will add all the attributes that are required for creating a new column in MOSS. The syntax of the command is as follows:

C:\>stsadm -help gl-gen2003to2007profilepropertymap

stsadm -o gl-gen2003to2007profilepropertymap

Generates a mapping file to map SharePoint 2003 profile data into a SharePoint 2007 SSP.

Parameters:
        -profdb2003 <database server containing the 2003 profile database>
        -profdbname2003 <2003 profile database name>
        -sspname <name of the 2007 SSP>
        -output <mapping file to generate>

Here’s an example of how to create a profile map that you can then manipulate:

stsadm –o gl-gen2003to2007profilepropertymap –profdb2003 "dbserver" -profdbname2003 "dbname" -sspname "SSP1" -output "c:\propertymap.xml"

After running this command you’ll get an xml file which you can then manually modify to meet your needs. The structure of the xml file is fairly simple:

1<ProfileMap>
2    <Property PropertyID="16" PropertyName="AboutMe" IsMultiValue="False" Length="3600" propertyName-2007="AboutMe" />
3    <Property PropertyID="30" PropertyName="CollegeMajor" IsMultiValue="False" Length="255" DisplayName="College Major" DataTypeName="string" IsAlias="False" IsEditable="True" IsPrivate="False" IsVisibleOnEditor="True" IsVisibleOnViewer="False" propertyName-2007="" />
4<ProfileMap> 

The above is a trimmed example but from it you can see one property that existed in both SPS 2003 and MOSS 2007 (AboutMe) and another which only existed in SPS 2003 (CollegeMajor). The propertyName-2007 attribute is the most critical as it is what tells the migration tool where to store the data. If this is empty then it will attempt to create the property (after verifying that it doesn’t already exist).

gl-migrate2003profilesto2007

Once you’ve created your property map you are ready to do the actual migration. As described above, this command takes the property map xml file as an input and loops through the properties, creating any missing properties and then loops through each profile in the 2003 database and setting the property values in MOSS. You can assign more than one 2003 property to a single 2007 property if that 2007 property is a multi-value property. The syntax of the command is as follows:

C:\>stsadm -help gl-migrate2003profilesto2007

stsadm -o gl-migrate2003profilesto2007

Migrates profile data and columns from a SharePoint 2003 profile database to SharePoint 2007

Parameters:
        -profdb2003 <database server containing the 2003 profile database>
        -profdbname2003 <2003 profile database name>
        -sspname <name of the 2007 SSP>
        -input <mapping file>

Here’s an example of how to migrate data using the mapping file:

stsadm –o gl-migrate2003profilesto2007 –profdb2003 "dbserver" -profdbname2003 "dbname" -sspname "SSP1" -input "c:\propertymap.xml"