Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zstd compress for 10x size reduction of backups #4270

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions website/docs/maintenance/backup_restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ If you are using `docker-compose`, you are using Docker Compose v1, which has be

## Backup

Create backup file `teslamate.bck`:
Create backup file `teslamate.bck.zst`:

```bash
docker compose exec -T database pg_dump -U teslamate teslamate > ./teslamate.bck
docker compose exec -T database pg_dump -U teslamate teslamate --format=custom --compress=zstd > ./teslamate.bck.zst
```

:::note
`-T` is important if you add this line a crontab or the backup will not work because docker will generate this error `the input device is not a TTY`
:::

:::note
Be absolutely certain to move the `teslamate.bck` file to another safe location, as you may lose that backup file if you use a docker-compose GUI to upgrade your teslamate configuration. Some GUIs delete the folder that holds the `docker-compose.yml` when updating.
Be absolutely certain to move the `teslamate.bck.zst` file to another safe location, as you may lose that backup file if you use a docker-compose GUI to upgrade your teslamate configuration. Some GUIs delete the folder that holds the `docker-compose.yml` when updating.
:::

:::note
Expand Down Expand Up @@ -49,7 +49,7 @@ CREATE EXTENSION earthdistance WITH SCHEMA public;
.

# Restore
docker compose exec -T database psql -U teslamate -d teslamate < teslamate.bck
docker compose exec -T database pg_restore -U teslamate -d teslamate < teslamate.bck.zst

# Restart the teslamate container
docker compose start teslamate
Expand Down
Loading