Files
archived-teslamate/website/docs/upgrading.mdx
T
DrMichaelandAdrian Kumpf 7ebdb97fd2 Update upgrading.mdx (#602)
* Update upgrading.mdx

Changed backup_restore.md to backup_restore

* Fix document path

Co-authored-by: Adrian Kumpf <adrian.kumpf@posteo.de>
2020-04-19 12:50:41 +02:00

62 lines
1.3 KiB
Plaintext

---
id: upgrading
title: Upgrading to a new version
sidebar_label: Upgrading to a new version
---
:::info
Check out the [release notes](https://github.com/adriankumpf/teslamate/releases) before upgrading!
:::
:::note
Create a [backup](maintenance/backup_restore) before updating.
:::
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs
defaultValue="docker"
values={[
{ label: 'Docker', value: 'docker', },
{ label: 'Manual install', value: 'manual', },
]}>
<TabItem value="docker">
Pull the new images and restart the stack:
```bash
docker-compose pull
docker-compose up
```
</TabItem>
<TabItem value="manual">
1. 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
MIX_ENV=prod mix do phx.digest, release --overwrite
```
2. Most upgrades requires to run new database migrations. If so continue with the following command:
```bash
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
```
3. Finally, re-import the Grafana dashboards:
```bash
LOGIN="user:pass" ./grafana/dashboards.sh restore
```
</TabItem>
</Tabs>