Moving device deletes its automation

Is there a way to protect the automation of a device from getting deleted when I need to move the automated device into a parent group? Once it became important and it was an enormous efford to get this automated device into a parent group. Took almost an hour with storing presets of the original automation curves and then pasting them into the desired parameter.

Is there another way of moving devices and their automations? Or does anyone have a better workaroud for this problem?

there are tools to copy the automation