We recently completed a content architecture refactoring initiative that involved restructuring an existing Supercategory hierarchy, including updates to the parent Supercategory name, associated URL pattern, and downstream child Categories.
As part of this effort, we wanted to align the underlying folder structure with the updated taxonomy. Our original plan was to create a new folder reflecting the revised naming convention and migrate all file assets (image files) from the legacy folder to the new location. However, based on our review of the dotCMS Folders & Files documentation (Folders & Files | dotCMS Dev Site), we were unable to identify a scalable or efficient method for performing a bulk relocation of file assets between folders.
Following an audit of the existing folder contents, we confirmed that all assets within the folder were associated with the category being renamed and that no files needed to remain in the original location. Given this, we opted to rename the existing folder rather than execute an asset migration.
Could you clarify whether dotCMS provides a recommended approach for bulk transferring file assets between folders, either through platform functionality, APIs, content operations, or other supported mechanisms beyond those described in the Folders & Files documentation?
Kyle,
If I understand your question I think this is what your are looking for.
Option 1:
In the UI, the Content Search screen (not the Site Browser) lets you multi-select file assets, filter them by category and content type, and trigger a bulk “Move” action from the actions menu.
On your actual decision: renaming the existing folder rather than migrating was reasonable. dotCMS folders keep a persistent identifier through a rename, so the contained file assets stay correctly associated without needing a migration.
Option 2:
Bulk move via the Workflow REST API. The bulk-fire endpoint, PUT /api/v1/workflow/contentlet/actions/bulk/fire, accepts either a Lucene query (e.g., +contentType:FileAsset +categories:oldCategoryKey) or an explicit list of contentletIds, plus a workflowActionId. If that action has dotCMS’s built-in Move actionlet wired into it, you pass the destination in additionalParams.additionalParamsMap._path_to_move as a full host+path string (e.g., //yoursite.com/new-folder-name/), and every matched or listed file asset is relocated to the new folder in one call. Because it drives off a Lucene query, you can target “everything tagged with category X” directly rather than enumerating file IDs — which is the scalability gap you ran into. It’s also a true move: identifiers and version history are preserved, unlike re-uploading through dotCLI/WebDAV to a new path, which effectively creates new assets at a new location.
To get the workflowActionId, call GET /api/v1/workflow/contentlet/{inode}/actions on one file asset in scope (or GET /api/v1/workflow/schemes/{schemeId}/actions) and look for the action that has the Move actionlet attached — the default System Workflow ships with a Move action for this purpose; if you’re on a custom scheme it may need to be added to a step first.
There is another option in ‘WebDav’ through Cyberduck. Basically you mount the dotCMS folder structure on your local machine, and then you can just drag and drop the files where you want them to go as if you were using file explorer on your OS.
This is a good option for one off transfers, or for anyone who wants to quickly throw file assets into dotCMS.
(It says deprecated, but it is still a viable solution for this use case)
There is yet another option. Create a content structure with a Binary file field, your categories/supercategories and use the API and some Velocity/JS to populate it. Then you will be free of the tyranny of directories and files, as the content will live as a blob in db- it will become database content and you will have every possible method of dealing, searching, sorting, pulling, etc. with them. Since it is images, you can also use all the cool binary file type tools that will allow you to serve processed (resized, recolored, resampled) images instead of flat files.
If you want to go this route, I can give you some sample code to demonstrate how to do it.
Another option would be to use the import tool in the search screen. You could do an csv export of your files and change the folder identifiers to the correct folders and then import that csv. that should move all the folder locations