Custom Entities' IDs lost when home-assistant_v2.db is recreated

I’m using HA 0.80 in a Docker container on a Synology DS415+.

From time to time, home-assistant_v2.db gets corrupted and I get errors about the recorder component. From what I could understand, the easiest way to fix it is to remove the file as it gets recreated. Fine.

However, when I delete it (and nothing else is changed by me), the zwave custom entities’ ID get lost.

I searched for my custom strings in all files in the config dir and can’t find anything, so can I conclude that they are stored in the db? Can this be configured somehow?