How to move photos to a new folder that replicates the original hierarchy

I’m just getting started with digiKam as a DAM (I have been using Darktable’s lighttable for a bit, but thought it was worth trying something more purpose-built), and I am struggling to find a good solution to my culling/organization problem. I shoot JPG+RAW, and after importing the photos to digiKam with date and event-based directories (e.g., $HOME/Pictures/Raw-files/2026/2026-03-01_event/S01.jpg), I use the preview to quickly mark jpgs that I want to keep/highlight, and on the second pass, raw files that I want to edit with darktable. I have Immich as a photos library using the “External Library” feature, where I move my selected jpgs, and the exported files that come from the edited raws. These output files reside in a different directory with the same hierarchy e.g., $HOME/Pictures/Edited-and-culled-photos/2026/2026-03-01_event/S01.jpg.

I can manually recreate the directory hierarchy, but it would be nice to find a way to get digiKam to do this for me. I have tried using the “Batch Queue Manager” tool with a “User Shell Script”, but haven’t been able to get this to work - I think due to the requirements around $INPUT and $OUTPUT expressions.

Does anyone have any suggestions/recommendations for what to do in this situation?

Short update. The user shell script below sort of works, but it creates an additional copy in the primary folder selected in the “Target” options of the Batch Queue Manager tool.

DEST=$(printf '%s\n' "$INPUT" | sed 's#/Pictures/Raw-files/#/Pictures/Edited-and-culled-photos/#')

mkdir -p "$(dirname "$DEST")"

cp "$INPUT" "$DEST"
cp $INPUT $OUTPUT

if [ -e "${INPUT}.xmp" ]; then
  cp "${INPUT}.xmp" "${DEST}.xmp"
fi

Adding a line at the end rm -f $OUTPUT doesn’t resolve the file, unless I add ln -s "$DEST" "$OUTPUT" to create a symbolic link for $OUTPUT, but this clutters my digiKam.

I guess this is just a limitation of the BQM, but I haven’t found a better solution, outside of using an external script that uses xmp picker/ratings data to filter which items should be processed in this manner?