jhorsman
6/29/2016 - 11:56 AM

Copy over AppData from one SDL Web Content Manager item to the other. I used this script to repair a Media Manager ECL stub schema after con

Copy over AppData from one SDL Web Content Manager item to the other. I used this script to repair a Media Manager ECL stub schema after content porting it. During Content Porting somehow the AppData was lost and with this script I restored it from another working ECL stub schema.

$sourceEclStubSchemaId = 'tcm:25-557-8'
$targetEclStubSchemaId = 'tcm:25-368-8'

$ErrorActionPreference = "Stop"

# Using Tridion Powershell Modules from https://github.com/pkjaer/tridion-powershell-modules
Import-Module Tridion-CoreService  
$core = Get-TridionCoreServiceClient                              

$appData = $core.ReadAllApplicationData($sourceEclStubSchemaId)

## Danger Zone - uncomment the following lines if you know what you are doing
#$core.SaveApplicationData($targetEclStubSchemaId, $appData)
#Write-Output "Copied AppData from $sourceEclStubSchemaId to $targetEclStubSchemaId"

Write-Output $appData