3

As part of a data-migration script, I need to be able to rollback a Component to a previous (known) version. How do I do that using the Coreservice (sites 9.0)?

Bonus points for Powershell syntax ....

=> "Rollback component tcm:1-123" to version 8"

2 Answers 2

4

In powershell:

Import-Module "Tridion-CoreService"

# rollback
$client = Get-TridionCoreServiceClient
$client.Rollback("tcm:1-123-v8", $false, "rolling back", $null)
$client.Close()
"Done"
3

The Core Service has a "Rollback" method:

VersionedItemData Rollback(
    TcmUri id,
    bool deleteVersions,
    string comment,
    ReadOptions readBackOptions
)

id - The identifier of the VersionedItemData to rollback. The identifier must be a TCM URI including the version to rollback to.

deleteVersions - Specifies whether to delete all versions after the given version or to create a new version which is a copy of the given version.

comment - Comment for the specified version. Usually used to list references to items that no longer exists. Maybe null or "".

readBackOptions - Specifies how the VersionedItemData is read back after rolling back. If the parameter is null, the object is not read back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.