Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to create a package after deleting a few nodes and taking only references of deletion node instead of entire folder while creating the package on aem

Avatar

Level 1

Hi All,

I have deleted few nodes from /etc/map.publish.prod/http. Now I want to create a package with only deleted nodes, so that when it will be installed on production, it will just delete the mentioned existing nodes rather than installing the full /etc/map.publish.prod/http. Is there a way to mention to delete the selected nodes in a package. and when this package is built and installed on another instance(prod) it should delete the mentioned nodes in the created package.

I would appreciate for your help.

Thanks,

Manasi

 

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hello,

 

Here is my suggestion (to try once)

 

1. first build the package using those nodes for example

/etc/map.publish.prod/http/node1 and /etc/map.publish.prod/http/node2

2. once the package built. now change those node name manually to you local node (which makes existing node as deleted)

let's say/etc/map.publish.prod/http/node11 and/etc/map.publish.prod/http/node21

3. Now, rebuild the same package again without changing anything there. now when it build, it will consider those nodes to be deleted

4. now before installing the current build package, just rename those nodes name again back to previous 

ie. /etc/map.publish.prod/http/node1 and /etc/map.publish.prod/http/node2

5. now after doing that when you reinstall the package, it will install the package via deleting these nodes 

 

note: before doing in prod, try it local. also plz track of deactivating such nodes first before running otherwise your publish node will become stale.

 

hope it works for you.

 

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @Manasi27 

 

If a node is delete from a path, you cannot package it again and even if we try to do so by adding the path in package manager, it will not allow us to build as the path does not exist.

Let's say you have deleted node 1 and node 2 from /etc/map.publish.prod/http i.e. earlier it was /etc/map.publish.prod/http/node1 and /etc/map.publish.prod/http/node2 and now you do not have it.

 

We will not be able to package it and to remove the same node form upper environments either you need to package the parent directory and deploy it or you can delete only these nodes manually on upper environments.

 

If you do not have access to crx/de on upper environment, then packaging the parent node and deploying it on upper environment will be the best option.

 

Thanks!

Avatar

Correct answer by
Level 9

Hello,

 

Here is my suggestion (to try once)

 

1. first build the package using those nodes for example

/etc/map.publish.prod/http/node1 and /etc/map.publish.prod/http/node2

2. once the package built. now change those node name manually to you local node (which makes existing node as deleted)

let's say/etc/map.publish.prod/http/node11 and/etc/map.publish.prod/http/node21

3. Now, rebuild the same package again without changing anything there. now when it build, it will consider those nodes to be deleted

4. now before installing the current build package, just rename those nodes name again back to previous 

ie. /etc/map.publish.prod/http/node1 and /etc/map.publish.prod/http/node2

5. now after doing that when you reinstall the package, it will install the package via deleting these nodes 

 

note: before doing in prod, try it local. also plz track of deactivating such nodes first before running otherwise your publish node will become stale.

 

hope it works for you.

 

Avatar

Community Advisor

@Manasi27 - 
You can manually give the path of the node in the package Manager and try to build that package and the try to deploy wherever you want.