Expand my Community achievements bar.

SOLVED

AEM Content Migration and Pages Creation

Avatar

Level 10

Hi all, Let us say we are migrating content from an external system to AEM. First I would create templates, workflows and components in AEM. Then I migrate the content to AEM JCR. Now, my question is regarding creating AEM pages using the migrated content. Does this have to be done manually necessarily? Or Migration automation script could be extended to create AEM pages using the templates, dropping components on to the pages and configuring them? It is like automation script executing what normally a content author would do manually. Appreciate your support. Thanks, Rama.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hello

If you already have everything needed on AEM (templates, page component(s), components), you could generate a JSON file (as an example http://localhost:4502/content/we-retail/us/en/experience.infinity.json) with the data you want to migrate placed on the AEM counterpart components.

Then using the sling post servlet you could import it back the updated JSON file into AEM. It can be done using curl, for example:

curl -u user:password -F:operation=import -F:contentType=json -F:replace=true -F:replaceProperties=true -F:contentFile=@jsonFile  destinationPath


View solution in original post

5 Replies

Avatar

Employee Advisor

You can definitely  create AEM pages programmatically by calling backend JCR and AEM APIs. The AEM repository allows you to programmatically create new nodes and perform other CRUD operations.

The content which you are migrating can be loaded into AEM after you know how that content is going to be represented in the repository node structure. And once you know the node structure then you can create the nodes and their properties programmatically by calling AEM APIs.  

Avatar

Level 10

You can create pages programmatically based on the design of your app. In your migration script, you could build the intelligence to define content-to-component/template mappings based on your use case(s).

I assume that you mean assets (js/css/images etc.) with this statement and not the actual content nodes (text paragraph, structured or unstructured content) in AEM terminology -  "Then I migrate the content to AEM JCR."

Avatar

Level 10

Even though it's possible to use APIS to develop pages - its best practice to build an AEM muliti-page site using editable templates --  as discussed in this Adobe document - Getting Started with AEM Sites - WKND Tutorial

Avatar

Level 10

Hi all, Let us say the AEM page has 2 text boxes, 5 images and 3 videos. After extraction, we have an XML file for Transformation and Loading. And after loading, we will have these 2+5+3 assets sitting in JCR. When I create this page programmatically, I could use PageManager APIs and select the AEM template. Now, my question is how to link the 2 text boxes, 5 images and 3 videos to the artifacts in JCR? How could I put this mapping in the program? Appreciate your responses. Thanks, Rama.

Avatar

Correct answer by
Level 2

Hello

If you already have everything needed on AEM (templates, page component(s), components), you could generate a JSON file (as an example http://localhost:4502/content/we-retail/us/en/experience.infinity.json) with the data you want to migrate placed on the AEM counterpart components.

Then using the sling post servlet you could import it back the updated JSON file into AEM. It can be done using curl, for example:

curl -u user:password -F:operation=import -F:contentType=json -F:replace=true -F:replaceProperties=true -F:contentFile=@jsonFile  destinationPath