Upgrading to a new version
Check out the release notes before upgrading!
Create a backup before updating.
If you are using docker-compose
, you are using Docker Compose v1, which has been deprecated. Docker Compose commands refer to Docker Compose v2. Consider upgrading your docker setup, see Migrate to Compose V2
- Docker
- Manual install (Debian)
- Manual install (FreeBSD)
Within the directory where the YML file is located, pull the new images:
docker compose pull
and restart the stack with docker compose up
. To run the containers in the background add the -d
flag:
docker compose up -d
-
Pull the new changes from the git repository, checkout the new version and then build the new release:
git pull
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
mix deps.get --only prod
npm install --prefix ./assets && npm run deploy --prefix ./assets
rm -rf _build
MIX_ENV=prod mix do phx.digest, release --overwrite -
Most upgrades requires to run new database migrations. If so continue with the following command:
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
Note, you may need to include environment variables when running this step:
DATABASE_USER=teslamate DATABASE_PASS=super_secret_password DATABASE_NAME=teslamate DATABASE_HOST=localhost MQTT_HOST=your_MQTT_host(HomeAssistant in my case) _build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
-
Finally, re-import the Grafana dashboards:
LOGIN="user:pass" ./grafana/dashboards.sh restore
-
Pull the new changes from the git repository, checkout the new version and then build the new release:
bash
git pull
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
mix deps.get --only prod
npm install --prefix ./assets && npm run deploy --prefix ./assets
rm -rf _build
export MIX_ENV=prod
mix do phx.digest, release --overwrite -
Most upgrades requires to run new database migrations. If so continue with the following command:
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
Note: you may need to include environment variables as part of this step:
DATABASE_USER=teslamate DATABASE_PASS=super_secret_password DATABASE_NAME=teslamate DATABASE_HOST=localhost MQTT_HOST=your_MQTT_host(HomeAssistant in my case) _build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
-
Finally, re-import the Grafana dashboards:
bash
export LOGIN="user:pass"
./grafana/dashboards.sh restore