Closed wyx087 closed 2 months ago
The process is pretty much what is documented in the TeslaMate docs with a few tweaks to use docker exec [POSTGRES CONTAINER ID]
instead of docker compose
.
Your question has motivated me to finally make the switch. I’ll try find some time this weekend and I’ll document my steps.
Thanks for reply. But how do I run docker exec commands in Home Assistant OS?
Use an SSH add on? But they are sandboxed from each other isn’t it? Need host level access, somehow?
Hi lildude,
Thanks for taking up the mantle with this Teslamate addon.
Please can you help me migrate from matt-FFFFFF's PostgreSQL 12.5 addon to alexbelgium's Postgres 15 addon?
The docker compose command in Teslamate documentation doesn't map into Home Assistant addon. What other way is there to do this database migration? Could alex's Portainer addon help here?
Sorry, I've only used HA addons. Docker commands is completely out of my depth.
Thanks very much
I did a migration a few weeks back. Out of memory did I do those steps: 1 Install Add-on "pgAdmin4" from https://github.com/expaso/hassos-addons 2 Start the add on and open the web UI 3 Make two connections, 1 to your old postgres and the other to the new postgres 4 create new database with same name as the old database on the new postgres instanc 5 create a new postgres user with same username and password on the new postgres DB. 6 now make a backup of the old DB 7 now restore. select the new database and right click and select "restore" 8 stop old postgres database 9 reconfig teslamate with paramaters to use the new postgress hostname (username and pwd should be the same, because you have created it in step 5) 10 start teslamate
good luck
Awesome, that worked. Thank you very much for your help.
Needed some juggling because both PostgreSQL addons used the same port and pgAdmin wouldn't connect to a different port for me.
Everything seems to work so far. Yet to take a drive but it's fetching data as expected, when car is woken up.
Thanks very much for keeping this great addon going.
---- Edit: Added step 11, needed to change data source in Grafana to new Postgres addon.
Now verified all previous data and new driving are recorded and visible in Grafana.
---- Edit 16th September:
I noticed Postgres was restarting every 2-3 minutes and I was getting miles in "Data lost (not logged)" under battery health view. Trips has lots of short interval drives without start or stop location.
Fix(es!):
/usr/local/pgsql-15
to PostgreSQL 15) So far Postgres is stable have not auto restarted for a while. TeslaMate isn't generating errors in its logs and Grafana can still read all the data from the start.
---- Edit later on same day, 16th
The problem restarting every 2-4 minutes came back, it has nothing to do with database names or username. It is due to my Proxmox ZFS storage replication. Removing this replication task that was set to every 2 minutes (it was in error state when I was fixing Postgres earlier) seems to make Postgres stable.
But above info for Postgres from 12 to 15 may still be useful to people.
Hi lildude,
Thanks for taking up the mantle with this Teslamate addon.
Please can you help me migrate from matt-FFFFFF's PostgreSQL 12.5 addon to alexbelgium's Postgres 15 addon?
The docker compose command in Teslamate documentation doesn't map into Home Assistant addon. What other way is there to do this database migration? Could alex's Portainer addon help here?
Sorry, I've only used HA addons. Docker commands is completely out of my depth.
Thanks very much