Expand my Community achievements bar.

The ability to create ideas and blogs are temporarily disabled. We apologize for the inconvenience.

Rename/Move an AEM Asset programmatically and Update References

Avatar

Community Advisor

10/7/25

AEM Discussions

Rename/Move an AEM Asset programmatically and Update References  by Aanchal Sikka

 

Overview

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/ 

 

Q&A

Please use this thread to ask questions relating to this article

3 Comments