Back to Teslamate

Upgrading PostgreSQL to a new major version

website/docs/maintenance/upgrading_postgres.md

3.0.0752 B
Original Source
  1. Create a backup

  2. Stop all TeslaMate containers

    bash
    docker compose down
    
  3. Delete the database volume. Be careful, this will delete all your previously recorded data! Make sure that your backup can be restored before you start.

    bash
    docker volume rm "$(basename "$PWD")_teslamate-db"
    
  4. Change the postgres version and ensure your volume mount is configured correctly in docker-compose.yml and start the container

    yml
    database:
      image: postgres:18-trixie
      ...
      volumes:
        - teslamate-db:/var/lib/postgresql
    
    bash
    docker compose up -d database
    
  5. Restore the backup