Renaming or moving assets in AEM while keeping all references intact is a common challenge for developers. Basic APIs like AssetManager.moveAsset()
can rename or relocate assets but do not update references across your site, often leading to broken links.
This blog breaks down two approaches:
-
Using AssetManager.moveAsset()
for simple moves without reference updates.
-
Alternate way with CopyMoveCommandBuilder
, which renames assets and automatically updates all references, ensuring content consistency.
The blog includes sample servlet code demonstrating how to implement the CopyMoveCommandBuilder approach.
Link to blog: https://techrevel.blog/2025/10/07/rename-move-an-aem-asset-programmatically-and-update-references/