• Not Answered

Sitecore Archives

Hi there,

We are looking to migrate contents using migrate tool from Sitecore 7 to 8. We are using migration tool 2.0. Before we run migration we want to remove some of the items from the "Archive"

Is that right that migration tool 2.0 does not provide functionality to migrate Archived items? But one can use SQL queries to copy items from one version to another?

Also,

I did not find any out of the box solution in sitecore to delete the filtered Archived items in bulk; I tried Sitecore Rocks too but no success so far.

Is the only way to delete the bulk filtered items from Archived location is via SQL queries? Have not found anything on community yet. 

 

Many thanks

Imran

1 Reply

  • Found a powershell query online which I edited to delete the archives

    [datetime]$archivedDate = [datetime]::Today.AddDays(-1)
    Write-Host "Removing items archived before $($archivedDate.ToShortDateString())"

    foreach($archive in Get-Archive -Name "archive") {
    Write-Host " - Found $($archive.GetEntryCount()) entries"
    $entries = $archive.GetEntries(0, $archive.GetEntryCount())
    foreach($entry in $entries) {
    if($entry.ArchiveLocalDate -le $archivedDate) {
    Write-Host "Removing item: $($entry.OriginalLocation) {$($entry.ArchivalId)}on date $($entry.ArchiveLocalDate)"
    $archive.RemoveEntries($entry.ArchivalId)
    } else {
    Write-Host "Skipping $($entry.OriginalLocation) on date $($entry.ArchiveLocalDate)"
    }
    }
    }