Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. ##############################
  2. # Convert Publish States #
  3. ##############################
  4.  
  5. # Settings assumed to be available from previous script, uncomment, and optionally correct, if this is not the case
  6. # $StagingLiveTopologyType="StagingLive"
  7. # $purposeLive="Live"
  8. # $purposeStaging="Staging"
  9.  
  10. # Additional Settings, to be updated
  11. $dbUser = "dbUser"
  12. $dbPassword="dbPassword"
  13. $dbServer="dbServer"
  14. $dbInstance="dbInstance"
  15.  
  16. #################################
  17. # Do not change below this area #
  18. # Unless you know what and why #
  19. #################################
  20. $client = Get-TridionCoreServiceClient
  21.  
  22. # Determine source target and destination targettypes
  23. $sourceStagingTargetId = @(Get-TridionPublicationTargets|Where {$_.Title -eq $purposeStaging})[0].Id.Split("-")[1]
  24. $targetStagingTargetTypeId = @((Get-TridionItem($client.GetBusinessProcessTypes($StagingLiveTopologyType)[0].IdRef)).TargetTypes| Where-Object{$_.Purpose -eq $purposeStaging})[0].Id.Split("-")[1]
  25.  
  26. $sourceLiveTargetId = @(Get-TridionPublicationTargets|Where {$_.Title -eq $purposeLive})[0].Id.Split("-")[1]
  27. $targetLiveTargetTypeId = @((Get-TridionItem($client.GetBusinessProcessTypes($StagingLiveTopologyType)[0].IdRef)).TargetTypes| Where-Object{$_.Purpose -eq $purposeLive})[0].Id.Split("-")[1]
  28.  
  29. # Run Convert statements
  30. Convert-TcmPublishStates -DatabaseType MsSql -SourceId $sourceLiveTargetId -SourceType PublicationTarget -DestinationTargetTypeId $targetLiveTargetTypeId -Server $dbServer -DatabaseName $dbInstance -User $dbUser -Password $dbPassword
  31. Convert-TcmPublishStates -DatabaseType MsSql -SourceId $sourceStagingTargetId -SourceType PublicationTarget -DestinationTargetTypeId $targetStagingTargetTypeId -Server $dbServer -DatabaseName $dbInstance -User $dbUser -Password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement