SDL Web 8 introduces the ability for business users to view items in the website as well as create new Publications in a site wizard. These features rely on the new style publishing introduced as part of the topology management features of SDL Web 8.

In order to take advantage of the new features on an existing system, implementers and customers have asked for a way to migrate items published using legacy publication targets to the new-style content delivery environments in Topology Manager. After upgrade to SDL Web 8.1.1+, you may want to migrate items published via old-style Publication Target and avoid needing to republish items.

This post describes a cmdlet developed by SDL Web R&D to help implementers manage and repurpose legacy publishing setups. The following posts will include an example powershell script that uses this cmdlet as well as how to re-use existing purposes in new Business Process Types.

Use the Convert-TcmPublishStates cmdlet tool when:

  1. You have items published to legacy Publication Target for which you have configured Content Delivery Environment for new-style publishing.
  2. You want to change purpose of published items to another Business Process Type.

This script resets the publish states for items that were published to a source Publication Target and changes it to the "new-style" Target Type. The source publishing target could be either an old-style Publication Target or new-style Target Type.

Notes and recommendations:

  • The cmdlet and example script were designed for use by technical or administrative users familiar with Tridion publishing and Topology Manager in a sandbox or test environment. Be sure to test and modify the example script before applying it on a development environment to avoid creating an inconsistent publishing configuration.
  • Do not attempt to change, decompile, or modify the cmdlet, which uses internal methods and queries created by SDL Web R&D.
  • The cmdlet does not check that a given CD Environment exists for the destination Target Type, so make sure Topology Manager is set up correctly before use.

How to Run

In order to run Convert-TcmPublishStates cmdlet:

  1. Copy Tridion.ContentManager.PublishingConfigurationHelper.dll and Tridion.ContentManager.PublishingConfigurationHelper.dll-help.xml to any folder on your machine
  2. In Powershell execute:

    Import-Module "FULL_PATH_TO_Tridion.ContentManager.PublishingConfigurationHelper.dll_FILE"
  3. To get help on Convert-TcmPublishStates cmdlet execute:

    Get-Help Convert-TcmPublishStates -Full

Examples

1) This example repurposes published items from Target Type with id 1 to Target Type with id 2 on Microsoft SQL Server database.

Convert-TcmPublishStates -DatabaseType MsSql -SourceId 1 -SourceType TargetType -DestinationTargetTypeId 2 -Server localhost -DatabaseName Tridion_cm -User sa -Password password

  

2) This example repurposes published items from Publication Target with id 2 to Target Type with id 3 on Oracle database on Tridion_cm schema. Scope of the conversion is limited to Publication with id 4.

Convert-TcmPublishStates -DatabaseType Oracle -SourceId 2 -SourceType PublicationTarget -DestinationTargetTypeId 3 -PublicationId 4 -NetServiceName OracleInstance -SchemaName Tridion_cm -User system -Password password

  

3) This example repurposes published items from Publication Target with id 2 to Target Type with id 3 on Oracle database on Tridion_cm schema specifying that connection user has SYSDBA role.

Convert-TcmPublishStates -DatabaseType Oracle -SourceId 2 -SourceType PublicationTarget -DestinationTargetTypeId 3 -NetServiceName OracleInstance -SchemaName Tridion_cm -User sys -Password password -AsSysDba

 

In the next post, we share an example script that uses this cmdlet.

Tridion.ContentManager.PublishingConfigurationHelper.zip
Anonymous