The script I mentioned before is now available as app + multiple improvements.
It’s quite easy to use, “dry runs” are possible. and replacing an ‘old’ Y protocol device with a new Z protocol device is no problem;
all related flows get repaired, and afterwards you can simply remove the ‘old’ device: