Thursday, June 28, 2012

Migrate SharePoint 2010 content with managed metadata challenges - Part II migrate site collection from one webapp to another webapp with the same MMS

As we mentioned in previous post, it is very challenge to keep the integrity of the managed metadata column values when you migrate the content. Foe the ten use cases we mentioned in previous blog, some of them are much difficulty that others. In this blog I’ll provide solution to use cases #3 listed before to fix managed metadata column values become un-editable when we migrate site collection from one webapp to another webapp with the same MMS.

Let us set up the site collation so we could demonstrate the issues and solution.

1. First, we will create a site collection with URL http://sbx08/sites/MMDDHW/SitePages/Home.aspx
2. Second, we set up the global managed term group named “QCGlobal” with one Term Set named Set1 with two terms. Then set up site collection local Term Set named “LocalMMS” with two terms. You could view both global and local term store setting for this site collection from the following screen shot


3. Third, we create a list named “MMD1” with one managed column “LocalMMD” linked to local term store and another managed column named “GlobalMMD” linked to global term store
4. Finally, add a new item and link the localMMD and GlobalMMD to local and global terms “Test1” and “Global1


At this time, you could edit the item and verify both terms are linked to global or local term stores. Both columns are editable.

 

Let's migrate this site collection from this webapp to a different one with same MMS. I'm using site collection backup and restore method to demonstrate this. Here are the steps.
  •  Back up the existing site collection using powershell
             Backup-SPSite -Identity http://sbx08/sites/MMDDHW -Path C:\MMDDHW.bck
  • Create a new site collection http://sbx08:20339/sites/MMDDHW in destination webapp using blank template
  • Restore the existing collection destination webapp using powershell
            Restore-SPSite –Identity http://sbx08:20339/sites/MMDDHW  -Path C:\MMDDHW.bck  -Force

Now if you browse the site, you will see identical site collection comparing to source site collection.



However, when you try to edit the item with managed metadata column, the global column is editable but the local term is grayed out not editable. The reason global term is editable because we migrated the site collection to the webpp with same MMS. IF you migrate to a webapp with different MMS, the global term will also not editable as shown in the following screen shot.

 
The question is how to fix the local terms. I follow the same procedure and script published by SergeyZelenov even the script is not meant for this purpose. Here are the procedures to fix local terms.
  • Open Powershell ISE
  • Open RestoreSPSiteLocalTermSet.ps1 powesshell
  • Run Selection (F8) (Do not click Run!)
  • Enter the destination site collection URL http://sbx08:20339/sites/MMDDHW and click OK
  • You will see the following message
 PS C:\Users\harrycx> Restore-SPSiteLocalTermSetAccess
Site collection's access to term store group 'Site Collection - sbx08-sites-MMDDHW' restored successfully


 
Now, the issue resolved and both local and global columns are editable again!!!
There are some other ways you could use to migrate site collections from one webapp to another webapp. Here is the list of some of the ways with my suggestions.
  • Export and import (Do not use and prefer backup and restore as we discussed before)
  • Content DB detach and attach (Use it when site collection is larger than 15G)
  • Metalogix migration tools
  • DocAve migration tool (Prefer over Metalogix)
Does not matter what method you are using to migrate site collection, as long as it has been migrated to the webapp with SAME MMS, you could following the procedure listed above to fix the local terms. We will discuss other use cases including site collection migrated to webapp with different MMS later.

2 comments:

  1. Hi Harry

    The Link to Sergey's scipt does not work anymore. Could you please provide the script.

    Thanks a lot

    Andrea

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete