After creating a new virtualenv using Python 3 and testing a basic HA instance, I copied the .homeassistant from my Python 3.7 instance to the new homedir of the Python 3.9 instance on the same machine. After that, I changed the homedir of the homeassistant user on my RPI and rebooted HA.
So far, so good. All was working correct.
After adding light groups, I noticed that HA wouldn’t pick up the changes. Weird. After long searches on fora like these, I finally checked my HA instance using lsof. To my surprise, it was using the old .homeassistant zigbee.db database, which would suggest it was also used home-assistant_v2.db in the same location. It did. After changing the old configuration.yaml, the changes kicked in.
My question: There is no single reference to the old homedir in my configuration or in the virtualenv. So how is it HA is using the old config and DB? And - more importantly - how can I persuade HA to use its new config directory? After all, it is already using custom components and the like from the new home dir.