Expand my Community achievements bar.

SOLVED

Replacing older packages in AEM while installing packages

Avatar

Level 2

I am having a package named for-example.zip with version 0.0.1 and group my_packages. Now I have changed the group and name of the package from my_packages to aem_group and from for-example.zip to new-package.zip. But the contents of the packages are same. 
I want the new-package.zip to replace for-example.zip correctly while installing. I am trying to establish this by adding the name of the package in replace property in dependency tab.

 

Jitesh_Kathalka_0-1716369049310.png

 


Can someone please tell me if this is the correct way and how do I validate if the package has successfully replaced the other package?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Jitesh07 ,

To replace an older package with a new package in AEM, you can follow these steps:

1. Create the New Package: Create a new package with the updated group and name, in this case, "aem_group" and "new-package.zip". Make sure the contents of the new package are the same as the older package.

2. Update the Dependency: In the dependency tab of the new package, add the name of the older package ("for-example.zip") in the "Replace" field. This indicates that the new package should replace the older package during installation.

3. Install the New Package: Install the new package in AEM using the package manager. During installation, AEM will check the "Replace" field in the dependency and replace the older package with the new package.

To validate if the package has successfully replaced the older package, you can follow these steps:

1. Check Package Manager: After installing the new package, go to the Package Manager in AEM. Look for the older package ("for-example.zip") and verify that it is no longer listed. This indicates that the older package has been replaced.

2. Verify Package Contents: Open the new package ("new-package.zip") in the Package Manager and verify that the contents are the same as the older package. You can compare the files and folders within the package to ensure they match.

3. Test Functionality: Test the functionality of your application or website to ensure that it is working as expected with the new package. Verify that any changes or updates made in the new package are reflected correctly.

By following these steps and validating the package replacement, you can ensure that the new package has successfully replaced the older package in AEM.

View solution in original post

7 Replies

Avatar

Level 5

Hi @Jitesh07,

In general, as a best practice, if you want to remove older packages from AEM to optimize performance, it's good to have a simple groovy script which deleted the packages which are older than the specified time may be 30 or 60 days to keep your instance clean. Thanks.

 

Regards,

Hemalatha C

Avatar

Level 2

Hi @Hemalatha ,

I agree with you but my current scenario is like if the content of the package is same but only name or the group of the package is changed then I want this new package to replace the previous package.

Avatar

Correct answer by
Community Advisor

Hi @Jitesh07 ,

To replace an older package with a new package in AEM, you can follow these steps:

1. Create the New Package: Create a new package with the updated group and name, in this case, "aem_group" and "new-package.zip". Make sure the contents of the new package are the same as the older package.

2. Update the Dependency: In the dependency tab of the new package, add the name of the older package ("for-example.zip") in the "Replace" field. This indicates that the new package should replace the older package during installation.

3. Install the New Package: Install the new package in AEM using the package manager. During installation, AEM will check the "Replace" field in the dependency and replace the older package with the new package.

To validate if the package has successfully replaced the older package, you can follow these steps:

1. Check Package Manager: After installing the new package, go to the Package Manager in AEM. Look for the older package ("for-example.zip") and verify that it is no longer listed. This indicates that the older package has been replaced.

2. Verify Package Contents: Open the new package ("new-package.zip") in the Package Manager and verify that the contents are the same as the older package. You can compare the files and folders within the package to ensure they match.

3. Test Functionality: Test the functionality of your application or website to ensure that it is working as expected with the new package. Verify that any changes or updates made in the new package are reflected correctly.

By following these steps and validating the package replacement, you can ensure that the new package has successfully replaced the older package in AEM.

Avatar

Level 2

Hi @HrishikeshKa 

I have tried the following way but I can still see the 1st package ("for-example.zip") in package manager. So how do I know if it got replaced or not. Also in replace tab the correct format is in following way groupId:name:version.

Let me know what I can do next.

 

 

Avatar

Community Advisor

Hi @Jitesh07 ,

If you have followed the steps to replace the older package with the new package in AEM, but you still see the older package listed in the Package Manager, there could be a few reasons for this:

1. Verify the "Replace" Field: Double-check the "Replace" field in the dependency tab of the new package to ensure that it is correctly set to the name of the older package in the format "groupId:name:version". Make sure there are no typos or errors in the name.

2. Check Package Versions: Verify that the version number of the new package is higher than the version number of the older package. AEM uses the version number to determine which package to install, so if the version number of the new package is lower than or equal to the version number of the older package, AEM will not replace the older package.

3. Check Package Installation Status: Check the installation status of the new package in the Package Manager to ensure that it was installed successfully. If there were any errors during installation, AEM may not have replaced the older package.

4. Clear Package Manager Cache: Try clearing the Package Manager cache in AEM and refreshing the page. This can sometimes help resolve issues with package installation and display.

If you have verified all of the above and the older package is still listed in the Package Manager, you may need to contact your AEM administrator or Adobe Support for further assistance. They can provide more specific guidance based on your AEM version and configuration.

Avatar

Administrator

@Jitesh07 Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni