Team
We are redesigning our site. Both old and new site will be on AEM 6.5. Only the UX/UI will change. I want to know is there a way to automate the process programmatically migrate the content?
Site is a headless e-commerce platform containing many product details page numbering to close 140+.
All the product information, images etc. are manually authored in AEM.
I understand following steps functionally
1. Content Inventorying of current e-comm site with all the product information.
2. Do a mapping exercise of current template or form fields to new forms field.
I am keeping it at a very high-level. But is there a standard process to achieve this with minimum manual effort? Our US team is really lean and no one has time to sit and manually copy paste content.
Solved! Go to Solution.
Views
Replies
Total Likes
Hello,
I don't think CSV or Excel are OOTB options, but exporting anything as JSON from JCR is possible OOTB. Just replace ".html" with "6.json" or "infinity.json" (if it's enabled) at the end of your page URL.
I would usually do this with a Node.js script:
Here is an example Node.js method to import JSON content in JCR using the OOTB Sling Manipulation servlet:
/**
* Import content using Sling Manipulation servlet.
* {string} path - JCR Path to the parent node.
* {string} name - Name of the new node.
* {JSON} data - JSON data structure to import.
*
*/
export const importContent = async (path, name, data) => {
const formData = new URLSearchParams();
formData.append(':operation', 'import');
formData.append(':contentType', 'json');
formData.append(':name', name);
formData.append(':content', JSON.stringify(data));
return await fetch(`${process.env.HOST}${path}`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Authorization': process.env.AUTHORIZATION_HEADER
},
body: formData
})
.then(response => response.text())
.then(content => {
LOGGER.writeLogMessage(`*INFO* Action: Import, Path: ${path}, Name: ${name}, Data: ${JSON.stringify(data)}`);
return new DefaultSlingServletResponse(content);
})
.catch(error => LOGGER.writeLogMessage(`*ERROR* ${error}`));
};
Hope this helps,
Daniel
Hi,
Here are my two cents: there isn’t really a one-size-fits-all solution for migration since everything depends on various factors like timeline, resources, data modeling, types of assets involved, etc. If you’re asking about existing tools for migration, the short answer is not really. While there are some options to explore, such as those from ACS Commons, you’ll likely need to develop a custom script to programmatically transfer the content based on your mapping (the one you already recognized as a starting point), keep on mind that the mapping should be possible narrow down to components as well and not only templates. This approach will help minimize manual effort. Just remember that ETL processes are rarely 100% accurate, so you should budget for some manual adjustments after the migration. Finally, run automated tests afterward to ensure the accuracy and integrity of the content in the new design.
Hope this helps
Can we take an automated export in CSV or Excel where the raw content of various components are filled in various columns?
A page has let says X number of components and each component having their own dialogue box with fields to be filled. Is there a routine that we have OOTB where the content can be exported sorted by "Labels" of the fields of components?
Hello,
I don't think CSV or Excel are OOTB options, but exporting anything as JSON from JCR is possible OOTB. Just replace ".html" with "6.json" or "infinity.json" (if it's enabled) at the end of your page URL.
I would usually do this with a Node.js script:
Here is an example Node.js method to import JSON content in JCR using the OOTB Sling Manipulation servlet:
/**
* Import content using Sling Manipulation servlet.
* {string} path - JCR Path to the parent node.
* {string} name - Name of the new node.
* {JSON} data - JSON data structure to import.
*
*/
export const importContent = async (path, name, data) => {
const formData = new URLSearchParams();
formData.append(':operation', 'import');
formData.append(':contentType', 'json');
formData.append(':name', name);
formData.append(':content', JSON.stringify(data));
return await fetch(`${process.env.HOST}${path}`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Authorization': process.env.AUTHORIZATION_HEADER
},
body: formData
})
.then(response => response.text())
.then(content => {
LOGGER.writeLogMessage(`*INFO* Action: Import, Path: ${path}, Name: ${name}, Data: ${JSON.stringify(data)}`);
return new DefaultSlingServletResponse(content);
})
.catch(error => LOGGER.writeLogMessage(`*ERROR* ${error}`));
};
Hope this helps,
Daniel
@Prithwiraj_Deb Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes