infra/docs/obs-portal.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
606 B
Markdown
Raw Permalink Normal View History

# OpenBikeSensor Portal
## Docker Containers
2024-05-08 20:57:07 +00:00
- portal
- worker
- db
## Run database migrations
2024-04-28 00:01:34 +00:00
After an upgrade it is sometimes necessary to run database migrations or regenerate tiles.
```
docker exec -ti obs-portal tools/upgrade.py
```
## Dump database
2024-04-28 00:01:34 +00:00
Save database dump to `dump.sql` in the current working directory.
```
2024-04-28 00:01:34 +00:00
docker exec -ti --user postgres obs-portal-db pg_dump obs > dump.sql
```
## Restore database
2024-04-28 00:01:34 +00:00
Load database dump from `dump.sql` file.
`obs` database needs to exist before importing the dump.
```
cat dump.sql | docker exec -ti --user postgres obs-portal-db psql obs
```