I need to archive Sitecore items using Sitecore PowerShell. Any commnand that can be used to achieve this.?

2 Answers 2

# get item to archive
$item = Get-Item -Path '/sitecore/content/ITEM'

# see available archives for current database

# select archive that you want to use
$archive = [Sitecore.Data.Archiving.ArchiveManager]::GetArchive("archive",$item.Database)

# store an item in the archive

# browse archive entries

To get more useful function for Archive object see this class Sitecore.Data.Archiving.Archive


If you want to archive a particular item version then you need to write your logic like this.

# get item to archive and provide the version. Examle 3

$item = Get-Item -Path "master:" -Uri "sitecore://master/{6151ACBE-40C3-45D5-BCE8-5E939C461C12}?lang=en&ver=3"


$archive = [Sitecore.Data.Archiving.ArchiveManager]::GetArchive("archive", $item.Database)



Now when you go to the Archive window, you will see the version you have archived

enter image description here

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.