Is there a tool or system to migrate JCR component level changes? | Community
Skip to main content
New Participant
December 29, 2022
Solved

Is there a tool or system to migrate JCR component level changes?

  • December 29, 2022
  • 2 replies
  • 1723 views

let's say you develop a component to display some images based on a category field.  This gets deployed to your 5 cloud environments (dev, test, UAT, stage, prod etc).

 

On production and UAT the Content Authors add this component to various pages, and set the category values.

 

You now develop a new version of this component which you remove the category field, and add new fields such as categoryList.

 

When this new version of the component get deployed to each cloud environment, all pages which use this component get broken, as they expect a categoryList field.

 

We would want to run a script to add the new field to all existing instances of the component, and set its value to an array with the value of the old category field as the only element.  This would only run once, if not already run for that env.

 

This is very similar to migrating a SQL database change.  For this you would use a tool such as liquibase, which has  change scripts which get run when the system boots, if that script wasnt previously applied.  Liquibase happens to use scripts which contain SQL statements (for simple table structure or data changes), but could also contain code (for more complex changes).

 

This must be a pretty common problem for AEM?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

Hi @tb3dock,

I would recommend to use AEM Easy Content Upgrade tool

This is tool that will allow you to run groovy script automatically, as part of package installation.

Here are also other pros:

  • it is compatible with AEM as a Cloud Service
  • it includes groovy console and all dependencies needed to run it
  • it allows to run groovy script automatically, and make sure it will not be run again
  • it provides GUI that will allow you to check the results of any groovy script executed via AECU and trigger it manually once again if needed

Alternatively you can use Groovy Console as a stand alone tool:

But in that case you will need to run your scripts manually on each instance and each environment.

2 replies

Himanshu_Singhal
New Participant
December 29, 2022

@tb3dock As @lukasz-m mentioned AECU tool is the fit for your requirement. Whatever pros already mentioned, on the top of it, script written with AECU are indeed compact and saves a lot of boilerplate code.
If not AECU then standard Groovy script is the way. 

lukasz-m
lukasz-mAccepted solution
New Participant
December 29, 2022

Hi @tb3dock,

I would recommend to use AEM Easy Content Upgrade tool

This is tool that will allow you to run groovy script automatically, as part of package installation.

Here are also other pros:

  • it is compatible with AEM as a Cloud Service
  • it includes groovy console and all dependencies needed to run it
  • it allows to run groovy script automatically, and make sure it will not be run again
  • it provides GUI that will allow you to check the results of any groovy script executed via AECU and trigger it manually once again if needed

Alternatively you can use Groovy Console as a stand alone tool:

But in that case you will need to run your scripts manually on each instance and each environment.

TB3dockAuthor
New Participant
December 29, 2022

Hi, I tried to install this tool by putting this in the pom.xml for our cloud version (running locally), but it doesn't install it.

 

    <dependency>
        <groupId>de.valtech.aecu</groupId>
        <artifactId>aecu.complete.cloud</artifactId>
        <version>LATEST</version>
        <type>zip</type>
    </dependency>

After doing 

 

% mvn clean install -PautoInstallSinglePackageAuthor

 

There is no groovy console at http://localhost:4502/groovyconsole

and no "aem easy content upgrade" menu in author.

 

There is only this warning in the build output (and no errors):

 

[^[[1;33mWARNING^[[m] 'dependencyManagement.dependencies.dependency.version' for de.valtech.aecu:aecu.complete.cloud:zip is either LATEST or RELEASE (both of them are being deprecated) @ line 715, column 22

 

 

Himanshu_Singhal
New Participant
December 30, 2022

Adding dependency is not suffice. You need to embed the package to get it deployed on AEM. 
Like you do with any other dependency e.g. ACS commons package 

https://www.linkedin.com/pulse/how-add-third-party-bundle-you-aem-package-veena-vikraman - check this one for reference