Migrating (Zigbee) devices without losing automations/scenes

I recently bought a Sonoff Zigbee Bridge, flashed it with Tasmota and wanted to move all my devices (20+) from Zigbee2Mqtt to ZHA. In order to do so, I had to remove the devices from Zigbee2Mqtt to be able to rejoin via ZHA.
Unfortunately, at this point all my scenes and automations were also modified (e.g. actions were removed, when they were referring a Zigbee device).

I wonder if there is a better way to do such migrations, without basically having to do everything from scratch.

It would be nice if I could give a migrated device the same device name and the automation/scene stays untouched. Currently the only way I could imagine is, to manually restore the automations from YAML.

Any help appreciated :slight_smile: