When installing a package in AEM and you want to ensure that existing content in the repository is not overwritten while ensuring that content not present in the repository is not removed, you should use the update import mode.
The update import mode performs the following actions:
It updates existing content nodes in the repository with the nodes from the package being installed.
It does not remove any existing nodes or properties in the repository that are not present in the package.
It adds any new nodes or properties from the package to the repository.
This mode is particularly useful when you want to preserve any manual changes or additions that might have been made to the repository content outside of the package installations.
Here’s how you can specify the import mode during package installation:
Access Package Manager: Log into your AEM instance and navigate to the CRX Package Manager (e.g., http://localhost:4502/crx/packmgr/index.jsp).
Upload the Package: If the package is not already uploaded, click on "Upload Package" and select the package file from your local system.
Install the Package: Click on "Install" for the package you wish to install.
Choose the Import Mode: During the installation process, you will have the option to choose the import mode. Select update from the available options.
AEM Package Manager - Import Mode
Complete Installation: Proceed with the installation. The content will be updated according to the rules defined by the update import mode.
By using the update mode, you ensure that your repository content is updated without losing any existing nodes or properties that are not part of the package.
References:
These steps ensure that you manage content updates in a controlled manner, preserving existing repository content while incorporating updates from the installed package.