0

I'm working on cleaning up sitecore items where i have bunch of items sitting under various nodes so what i'm trying to archive is to move all under single folder and create alias on the original path.

For instance,

Path: /products/devices/brand/samsung/s10

  • Products
    • Devices
      • Brand
        • Samsung - Item
          • S10 - Alias
          • S10Plus - Alias
        • Nokia - Item
          • Nokia82 - Alias
          • Nokia2 - Alias

New Structure

Path : /brands/

  • Brands
    • Samsung
    • Nokia

How can i archive this by moving the item under brands folder while keeping the same id and other side create alias pointing to new location?

I have managed to move phones and create alias e.g. nokia2 but not sure how to move the parent item and replace with alias.

I've tried using powershell, see below but didn't work.

Copy-Item -Path 'master:/sitecore/content/Home/Products/Devices/Brand/Samsung/s10' -Destination 'master:/sitecore/content/Home/Brands/' -TransferOptions 0

Sitecore version 9.3

  • 1
    You should be using Move-Item instead of Copy-Item Move-Item -Path "master:\content\home\Demo" -Destination "master:\content\home\Demo1". Refer - doc.sitecorepowershell.com/… – Paulson Maclean Jun 25 at 14:10
  • but i would like to keep the child items under old structure as those are old alias items. – Uday Solanki Jun 25 at 15:31
  • ... if you move a parent item, the children under it are automatically "moved" – Mark Cassidy Jun 26 at 0:17
  • @MarkCassidy technically yes but trying to find logical/best solution to sort this out. – Uday Solanki Jun 26 at 11:16

Your Answer

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

Browse other questions tagged or ask your own question.