I use the Mosquitto add-on. After running amcrest2mqtt on a separate Pi4 I noticed there was an add-on I could install instead, thus freeing up my Pi. I installed it and everything worked great. My devices and entities were still associated as before; it was a seamless migration.
Then (after reading that someone had wanted to clean up old unused topics in MQTT) I decided to delete all the related topics via MQTT Explorer, assuming that they would just come back after I rebooted HA. Over in MQTT Explorer the topics had all reappeared. However, after trying a few things to get my devices and entities to reappear, Mosquitto wouldn’t bring any of them back to HA. I even deleted and reinstalled Mosquitto, to no avail.
Ultimately, I restored a previous backup of HA Core and that solved my problem. But I’m wondering what else I could have done, say if I couldn’t have just restored from backup.