Migrate from count to for_each

I was referring to the original question and suggestion of possible resolutions via the links. Currently I have 0.13.4 and a module that uses count for one of the resources and need to switch to the each method.

Question is how to update my state at the same time as updating my code? Because switching just the code causes havoc.

Looks like I can do
terraform state mv ‘packet_device.worker[0]’ ‘packet_device.worker[“device_name”]’ ?