6

We upgraded Sitecore 8.2 project to 9.1. Upgrade took around 1 month to finish and during this period, authors created/updated some items in old instance and they didn't make a note of those items.

So, now I want to compare both instances to find out items to migrate content from 8.2 to 9.1

Is there any way to find out what items got updated/created in old instance? Can this be done using Sitecore Powershell Remoting?

6

There are a few options included with SPE out-of-the-box which could aid in accomplishing this task. The detail below is produced with SPE 6.0 but much of it was available in previous versions.

Reports

There is a Content Report called Items last updated which can be used to find any items in the tree (typically content) that has changed after a specified date.

Example filtering criteria[1]

Comparing Instances

The following script provides a basic example at using SPE to compare the content between two instances beginning with the specified root item.

Clear-Host
$watch = [System.Diagnostics.Stopwatch]::StartNew()

$Username = "admin"
$Password = "b"
$Source = "https://abc.dev.local"
$Destination = "https://123.dev.local"

$localSession = New-ScriptSession -user $Username -pass $Password -conn $Source
$remoteSession = New-ScriptSession -user $Username -pass $Password -conn $Destination


$rootId = "{37D08F47-7113-4AD6-A5EB-0C0B04EF6D05}"

$sourceItemIds = Invoke-RemoteScript -Session $localSession -ScriptBlock { 
    $rootItem = Get-Item -Path "master:" -ID $using:rootId

    $itemIds = (@($rootItem) + @($rootItem.Axes.GetDescendants()) | Select-Object -ExpandProperty ID) -join "|"
    $itemIds
} -Raw

$destinationItemIds = Invoke-RemoteScript -Session $remoteSession -ScriptBlock {
    $rootItem = Get-Item -Path "master:" -ID $using:rootId

    $itemIds = (@($rootItem) + @($rootItem.Axes.GetDescendants()) | Select-Object -ExpandProperty ID) -join "|"
    $itemIds
} -Raw

$referenceIds = $sourceItemIds.Split("|", [System.StringSplitOptions]::RemoveEmptyEntries)
$differenceIds = $destinationItemIds.Split("|", [System.StringSplitOptions]::RemoveEmptyEntries)

$queueIds = Compare-Object -ReferenceObject $referenceIds -DifferenceObject $differenceIds | 
    Where-Object { $_.SideIndicator -eq "<=" } | Select-Object -ExpandProperty InputObject

$watch.Stop()
$totalSeconds = $watch.ElapsedMilliseconds / 1000
Write-Host "$($totalSeconds) seconds" -ForegroundColor Yellow
5

Welcome to Sitecore stackexchange.

RAZL RAZL - can be used to compare the items between two different Sitecore Instances. Please note this is a "paid" software.

Another option is to use Sitecore Courier - This open source module can compare sitecore serialized files in two folders and create a diff (update) package containing the differences.

There is also more information on this other post which you can refer - Comparing a Sitecore instance with a vanilla one

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.