Code Monkey home page Code Monkey logo

Comments (17)

cwanja avatar cwanja commented on June 12, 2024 1

Going to ask the obvious, is teslamate running? Is TeslaMate the name of the service in your YML file?

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 12, 2024 1

Done #3560.

and reverted :-) #3561

from teslamate.

cognotte avatar cognotte commented on June 12, 2024

Good evening

yes teslamate is working.

and this is indeed the name of the container in the yml.

from teslamate.

cwanja avatar cwanja commented on June 12, 2024

What is the output of docker compose ps and your docker-compose.yml file with passwords removed? Ironically, I do not think TeslaMate web service has to be actually running - just the database service. So that is an odd error to throw.

With the default YML from docs.teslamate.org and the exact same command, I have zero issues. Just updated TeslaMate to 1.28.2

from teslamate.

cognotte avatar cognotte commented on June 12, 2024

i'm running teslamate in a stack in Unraid

my stack

`version: "3"

services:
teslamate:
image: teslamate/teslamate:latest
restart: unless-stopped
environment:
- ENCRYPTION_KEY=************
- DATABASE_USER=teslamate
- DATABASE_PASS=**********
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=mosquitto
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all

database:
image: postgres:14
restart: unless-stopped
environment:
- POSTGRES_USER=teslamate
- POSTGRES_PASSWORD=**********
- POSTGRES_DB=teslamate
ports:
- 5432:5432
volumes:
- teslamate-db:/var/lib/postgresql/data

grafana:
image: teslamate/grafana:latest
restart: unless-stopped
environment:
- DATABASE_USER=teslamate
- DATABASE_PASS=***********
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
ports:
- 3000:3000
volumes:
- teslamate-grafana-data:/var/lib/grafana

mosquitto:
image: eclipse-mosquitto:2
restart: unless-stopped
command: mosquitto -c /mosquitto-no-auth.conf
ports:
- 1883:1883
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data

volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:

networks:
teslamate_default:`

from teslamate.

cwanja avatar cwanja commented on June 12, 2024

What is the output of docker compose ps and or docker ps?

from teslamate.

cognotte avatar cognotte commented on June 12, 2024

chrome_uyDtzfFHn7

from teslamate.

cognotte avatar cognotte commented on June 12, 2024

On the other hand, docker compose ps does not give anything.

from teslamate.

miga97 avatar miga97 commented on June 12, 2024

if you are using the stack and not the compose you should use the command without compose

docker exec -t [container name] pg_dump -U teslamate teslamate > /home/myuser/teslamate.bck

works for me

but I haven't been able to do a restore yet without using compose

from teslamate.

cognotte avatar cognotte commented on June 12, 2024

if you are using the stack and not the compose you should use the command without compose

docker exec -t [container name] pg_dump -U teslamate teslamate > /home/myuser/teslamate.bck

works for me

but I haven't been able to do a restore yet without using compose
Good evening,

Indeed, I got an error when trying to restore. On the other hand, thank you I managed to make my backup.

root@unraidmox:~# docker exec -T teslamate_database_1 psql -U teslamate -d teslamate < mnt/disk3/teslamate.bck
unknown shorthand flag: 'T' in -T
See 'docker exec --help'.

from teslamate.

miga97 avatar miga97 commented on June 12, 2024

Good evening,

Indeed, I got an error when trying to restore. On the other hand, thank you I managed to make my backup.

root@unraidmox:~# docker exec -T teslamate_database_1 psql -U teslamate -d teslamate < mnt/disk3/teslamate.bck unknown shorthand flag: 'T' in -T See 'docker exec --help'.

there is no flag -T in the "no compose" exec command.
In theory you should use one of the following flags: -t -i -it or no flag instead of -T
but I haven't found a way to make it work

there are some things that I didn't understand, but the backup should be lines of text that contain queries that re-populate the database, which is why to do the restore you are asked to create the functions in the database with that long command, like explained here

I found other commands that create backups with different formats ( source ), but I think that the reason why the backup is done like this is because it must be possible to pass the commands via string from outside the container

the solution I adopted was to connect to the container via bash and execute the commands directly inside the container, moving the files via a folder that I bind

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 12, 2024

Postgres DB Backup and restore only works with same postgres version...

Edit: to be clear: Postgres build in db dump can cause issues, thats why we use or own backup and restore commands.

from teslamate.

DrMichael avatar DrMichael commented on June 12, 2024

Postgres DB Backup and restore only works with same postgres version...

We probably should that add to the documentation in https://github.com/teslamate-org/teslamate/blob/master/website/docs/maintenance/backup_restore.md

from teslamate.

cwanja avatar cwanja commented on June 12, 2024

Postgres DB Backup and restore only works with same postgres version...

We probably should that add to the documentation in https://github.com/teslamate-org/teslamate/blob/master/website/docs/maintenance/backup_restore.md

Done #3560.

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 12, 2024

Postgres DB Backup and restore only works with same postgres version...

We probably should that add to the documentation in https://github.com/teslamate-org/teslamate/blob/master/website/docs/maintenance/backup_restore.md

No, as our process is fine. Do not use postgres backup feature. Use Teslamate backup feature.
I clarified above, sorry for not being clear in the first place.

from teslamate.

miga97 avatar miga97 commented on June 12, 2024

Postgres DB Backup and restore only works with same postgres version...

Edit: to be clear: Postgres build in db dump can cause issues, thats why we use or own backup and restore commands.
@JakobLichterfeld

I put the link to those methods just for information.

I used your guide to migrate the database and it worked, but I did it a little differently. I don't use docker compose, but instead I use docker stacks, as does the author of this issue.

I was unable to make the restore command work because of the " -T " and the solution I used is the one I explained previously: I ran the commands from inside the container taking the files from a bind folder

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on June 12, 2024

All good. The -T is mainly needed if you run a sheduled backup via cron. There you do not have a TTY and the command will fail. Using the -T option to provide a TTY and the command will success.

from teslamate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.