Managed metadata

Bonzai Intranet uses Managed Metadata for Document and Page categories and all navigation (mega navigation, header, footer). There is an out of the box tool that we can use to export the metadata from the source farm and import into the destination farm.

This procedure is documented on Bart Kuppens’s blog: http://blog.kuppens-switsers.net/sharepoint/migrate-managed-metadata-between-farms.

Note:

All the term groups in the source metadata service will be exported.

Bonzai Intranet uses Managed Metadata for Document and Page categories and all navigation (mega navigation, header, footer).

There is an out of the box tool that can be used to export the metadata from the source farm and import into the destination farm.

This procedure is documented on Bart Kuppens’s blog: http://blog.kuppens-switsers.net/sharepoint/migrate-managed-metadata-between-farms. Note that all the term groups in the source metadata service will be exported.

Run the following PowerShell in the source farm:

  1. Log in to one of the SharePoint servers in the source farm as a farm administrator.
  2. Open an elevated SharePoint Management Shell
  3. Run the following Powershell script, where:

<Path> is the full path (local file system or UNC share) and file name to a cabinet file (.CAB) to export the metadata into.

$mmsApplication = Get-SPServiceApplication | ? {$_.TypeName -eq "Managed Metadata Service"}

$mmsProxy = Get-SPServiceApplicationProxy | ? {$_.TypeName -eq "Managed Metadata Service Connection"}

Export-SPMetadataWebServicePartitionData $mmsApplication.Id -ServiceProxy $mmsProxy -Path <Path>

For example:

$mmsApplication = Get-SPServiceApplication | ? {$_.TypeName -eq "Managed Metadata Service"}

$mmsProxy = Get-SPServiceApplicationProxy | ? {$_.TypeName -eq "Managed Metadata Service Connection"}

Export-SPMetadataWebServicePartitionData $mmsApplication.Id -ServiceProxy $mmsProxy -Path "F:\temp\mms.cab"

Exporting the metadata with PowerShell

Note:

In multi-server farms, copy the cabinet file to a local drive on the destination farm’s SQL Server. Share the folder where it resides with the SQL Server service account (alternatively share with Everyone). If you share a folder on another server this process does not work because the cmdlet issues a SQL query that is executed on the local SQL Server.

Run the following PowerShell in the destination farm:

  1. Log in to one of the SharePoint servers in the destination farm as a farm administrator.
  2. Open an elevated SharePoint Management Shell
  3. Run the following PowerShell script, where:

<Path> is the full path (local file system or UNC share) and file name to a cabinet file (.CAB) to import the metadata from.

$mmsApplication = Get-SPServiceApplication | ? {$_.TypeName -eq "Managed Metadata Service"}

$mmsProxy = Get-SPServiceApplicationProxy | ? {$_.TypeName -eq "Managed Metadata Service Connection"}

Import-SPMetadataWebServicePartitionData $mmsApplication.Id -ServiceProxy $mmsProxy -Path <Path> -OverwriteExisting

For example:

$mmsApplication = Get-SPServiceApplication | ? {$_.TypeName -eq "Managed Metadata Service"}

$mmsProxy = Get-SPServiceApplicationProxy | ? {$_.TypeName -eq "Managed Metadata Service Connection"}

Import-SPMetadataWebServicePartitionData $mmsApplication.Id -ServiceProxy $mmsProxy -Path "\\sqlserver\restore\mms.cab" -OverwriteExisting

Importing the metadata into the destination farm