Showing posts with label SharePoint 2010 migration. Show all posts
Showing posts with label SharePoint 2010 migration. Show all posts

Tuesday, June 11, 2013

BCS BDC external data lookup field migration

Scenario
  • You want to programmatically set an External Data lookup field
    • Ex: Migrating data into a SharePoint list or library
Issue
  • In this case, we used Idera / Metalogix Migration Manager, which does not support External Data fields, nor do they plan on supporting it in the near future
    • This is likely due to the fact that they offer a client only (non-server deployed solution) and haven't figured out how to do this using the remote content deployment APIs
  • The result was that the external data field only displayed correctly in the View Item form and did not populate in the Edit item form or any of the related/projected fields in the view.
Resolution
  • Luckily I did have access to deploy a server solution, so I developed the following web part to handle the migration
    • If you are using Office 365 or don't have this access then you will need to develop your own solution or need to use a data synchronization solution instead (several vendors make these)
  • In order for this solution to work, you need to add a temporary column to the list that will store the IDs of the field you wish to migrate.  Note that this is not necessarily the display name.
    • In our case we migrated the ID column to a list column named SourceId, ran the tool, then deleted the SourceId column.
  • I utilized code from StackExchange and Jaspers' Weblog along with some forum posts, converting all to VB.Net for aesthetics
  • Download the code
    • The wsp solution file is located in the \SetExternalDataWebPart\bin\Release folder
    • You must enable the feature at the site collection level and add the web part to a page in the subsite that contains the list. 
    • In my test environment this tool updated 25 records every 10 seconds.
  • Notes
    • I found that in addition to setting the display name you also need to set the RelatedField to the BDCIdentity to get the correct value to display in the edit form and to be updateable via the refresh icon.
// Set the BCS field itself (Display Value)
listItem[dataField.Id] = dtBDCData.Rows[0][dataField.BdcFieldName].ToString();
// Set the related field to the BDC Identity
listItem[dataField.RelatedField] = dtBDCData.Rows[0]["BdcIdentity"].ToString();
  • Some other tips:
    • I had to use the RevertToSelf (BDC Identity) connection to get the refresh to function
    • I did not need to run with elevated or allowunsafeupdates except when debugging permissions.
  • Updated release info:
    • 6/27/2013
      • Added list ID range support to split copies into smaller chunks
        • Uses an SPQuery on ID field.
      • Added refresh interval for regular mid-copy status updates
        • These are actually just auto post backs using an asp.net timer control
    • 7/5/2013
      • Fixed refresh bug

Monday, February 27, 2012

SharePoint 2007 to 2010 Help Desk Upgrade

Scenario
  • You have installed the HelpDesk Fab 40 Template
  • You are performing a database attach upgrade from SharePoint 2007 or WSS 3.0 to SharePoint Server or Foundation 2010 and have run test-spcontentdatabase
Issue
  • The test-spcontentdatabase report contains the following errors (the cooresponding feature names have been added):
    • Category        : MissingFeature - HelpDeskModules
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-02cb-4f87-bb11-1ffde748a953].
      Remedy          : The feature with Id 75a0fea7-02cb-4f87-bb11-1ffde748a953 is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskListInstances, HelpDeskServiceRequestsList
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-fe9d-4119-9615-2c2ef22d6fdb].
      Remedy          : The feature with Id 75a0fea7-fe9d-4119-9615-2c2ef22d6fdb is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskListInstances, KnowledgeBaseKeywordsList
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-12fe-4cad-a1b2-525fa776c07e].
      Remedy          : The feature with Id 75a0fea7-12fe-4cad-a1b2-525fa776c07e is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskListInstances, HelpDeskTasks
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-3b2a-4838-8a0c-57ba864feed3].
      Remedy          : The feature with Id 75a0fea7-3b2a-4838-8a0c-57ba864feed3 is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskListInstances
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-97c5-4487-88e4-70fde8f79b25].
      Remedy          : The feature with Id 75a0fea7-97c5-4487-88e4-70fde8f79b25 is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskListInstances, HelpDeskSupportFaqList
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-70e3-40b1-b395-c06f85d0d158].
      Remedy          : The feature with Id 75a0fea7-70e3-40b1-b395-c06f85d0d158 is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskExpertsList, HelpDeskListInstances
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-e63b-4059-8f5a-ce9cbbadad2a].
      Remedy          : The feature with Id 75a0fea7-e63b-4059-8f5a-ce9cbbadad2a is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary.
    • Category        : MissingFeature - HelpDeskListInstances
      Error           : True
      UpgradeBlocking : False
      Message         : Database [MOSS_ContentDB] has reference(s) to a missing featu
                        re: Id = [75a0fea7-d31d-491a-9177-f0e461a81e3f].
      Remedy          : The feature with Id 75a0fea7-d31d-491a-9177-f0e461a81e3f is r
                        eferenced in the database [MOSS_ContentDB], but is not instal
                        led on the current farm. The missing feature may cause upgrad
                        e to fail. Please install any solution which contains the fea
                        ture and restart upgrade if necessary
  • There will also be some MissingSetupFile - Need to install messages as well.
Resolution
  • The following solution is to get existing sites working.  To create new sites using the fab 40 templates, you may download and install the 2010 upgraded versions
    • I would recommend starting from a blank site template to build a tailored solution instead of using these templates due to the issues we've had modifying and upgrading them
  • The solution is to copy and then install the missing features
    • Copy the erroring feature folders from the 12 hive on the 2007 server to the 14 hive on the 2010 server
      • ...\12\template\features
      • ...\14\template\features
      • The ones we copied were: HelpDeskExpertsList, HelpDeskInIssuesList, HelpDeskListInstances, HelpDeskModules, HelpDeskServiceRequestsList, HelpDeskSupportFaqList, HelpDeskTasks, HelpLibrary 
    • Install the features on the 2010 server from PowerShell (SharePoint 2010 Management Shell)
      • Ex: install-spfeature -path "helpdeskservicerequestslist"
        • Do this for each of the folders copied earlier