Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

[AEM6.5] bulk copy pages from one location to another location

Avatar

Level 6

Hi Team,

 

we have page and their unique UUID attatched to page and

I have a requirement where I have to do a bulk copy of page from one path to another path and also update uuid [since if we copy the page from one node to another it will copy the same uuid].

So current I have only magazine_us page is available which we have provided in source path [csc, or excel] and we want to copy it to different different locale and once we copied we need to update the uuid. like

SourceDestination
/content/my-project/en/us/magazine_us/content/my-project/ru/ru/magazine_ru
/content/my-project/en/us/magazine_us/content/my-project/es/es/magazine_es
/content/my-project/en/us/magazine_us/content/my-project/de/de/magazine_de
/content/my-project/en/us/magazine_us/content/my-project/fr/fr/magazine_fr
/content/my-project/en/us/magazine_us/content/my-project/ko/kr/magazine_ko

 

And going forward we have to provide publish/unpublish functionality to it.

How can I achieve this tool.

I have think of two ways to do 

 

1- Write a servlet which will read the xlsx and copy node to destination path

2- Use MCP like : https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/ad...

 

Can anyone please suggest me the best way to do it. or any sample code to refer it

Thanks

@kautuk_sahni   @lukasz-m  @arunpatidar  @kiran5 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

 

To achieve the bulk copy of pages from one path to another with updated UUIDs and provide publish/unpublish functionality, you can consider the following approach:

  1. Use the AEM Content Transfer Tool (ACT) from ACS Commons:

    • This tool provides an easy way to copy content nodes between paths with updated UUIDs.
    • You can use the ContentCopyOptions class to configure options like UUID handling, order preservation, etc.

Custom solution:

  • Write a servlet or a script that reads the source and destination paths from the Excel or CSV file.
  • Use AEM's APIs, such as the ResourceResolver and Session objects, to perform the copy operation.
  • For each page, generate a new UUID and update it using the UUID API.
  • Implement the publish/unpublish functionality using AEM's replication API, such as the Replicator class.

View solution in original post

2 Replies

Avatar

Community Advisor

@tushaar_srivastava This looks like Translation. Can you possibly request the translation provider to by pass the translation and send the content back?

Or can you possibly use AEM's translation project to just import the same content back.

 

If you have translation today, you must already be having a way to update the UUID.

If not, a page create event can be used to update the UUID via a workflow.

Any metadata that you could use to filter the target (manually imported) pages for Workflow launcher?

 

 


Aanchal Sikka

Avatar

Correct answer by
Employee Advisor

Hi,

 

To achieve the bulk copy of pages from one path to another with updated UUIDs and provide publish/unpublish functionality, you can consider the following approach:

  1. Use the AEM Content Transfer Tool (ACT) from ACS Commons:

    • This tool provides an easy way to copy content nodes between paths with updated UUIDs.
    • You can use the ContentCopyOptions class to configure options like UUID handling, order preservation, etc.

Custom solution:

  • Write a servlet or a script that reads the source and destination paths from the Excel or CSV file.
  • Use AEM's APIs, such as the ResourceResolver and Session objects, to perform the copy operation.
  • For each page, generate a new UUID and update it using the UUID API.
  • Implement the publish/unpublish functionality using AEM's replication API, such as the Replicator class.