As I said, DietPi does not control ports in real time. We set a certain configuration during installation, that’s it. If someone or something changes the ports afterwards, DietPi itself cannot do anything. This could be a user or the restore of a backup. It is then up to the user who performs the action.
I wouldn’t even say it’s an Octoprint problem. You simply restored a backup from another system where the port was apparently not specified. As a result, the configuration was overwritten.