Sharepoint - How to change site collection URL (Content Type Hub) in Managed Metadata service application

You can change it via PowerShell. See this article (Link Dead, 2019): http://www.sharepointanalysthq.com/2010/11/how-to-change-the-content-type-hub-url/

Archived Link : http://web.archive.org/web/20110119230901/http://www.sharepointanalysthq.com/2010/11/how-to-change-the-content-type-hub-url/

They basically show how to use this cmdlet:

Set-SPMetadataServiceApplication -Identity "<ServiceApplication>" -HubURI "<HubURI>"

I have this little powershell function you can try it out...

function SetManagedMetadaService
{
    Param(
            [parameter(Mandatory=$true)][string]$ServiceName,
            [parameter(Mandatory=$true)][string]$HubSiteUrl
        )

        Write-Host "Setting contenttype hub Url"

        #Get-SPServiceApplication | ForEach-Object {
        #   if ($_.TypeName -eq $ServiceName) { $MetadataInstance = $_ }
        #}

        $MetadataInstance = Get-SPServiceApplication -Name "Managed Metadata Service"

        Set-SPMetadataServiceApplication -Identity $MetadataInstance -HubURI $hubSiteUrl

        Write-Host -f yellow "Setting Proxy Metadata Service Options"

        # Get Metadata service application proxy  
        $metadataserviceapplicationproxy = get-spmetadataserviceapplicationproxy $ServiceName 

        # This service application is the default storage location for Keywords. 
        $metadataserviceapplicationproxy.Properties["IsDefaultKeywordTaxonomy"] = $true 

        # This service application is the default storage location for column specific term sets. 
        $metadataserviceapplicationproxy.Properties["IsDefaultSiteCollectionTaxonomy"] = $true 

        # Consumes content types from the Content Type Gallery 
        $metadataserviceapplicationproxy.Properties["IsNPContentTypeSyndicationEnabled"] = $true 

        # Push-down Content Type Publishing updates from the Content Type Gallery 
        # to sub-sites and lists using the content type. 
        $metadataserviceapplicationproxy.Properties["IsContentTypePushdownEnabled"] = $true 
        $metadataserviceapplicationproxy.update()       

}

And, remember to load the sharepoint snap in...

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
 if ($snapin -eq $null)
 {
     Write-Host "Loading SharePoint Powershell Snapin"
     Add-PSSnapin "Microsoft.SharePoint.Powershell"
 }

Tags:

Content Type