2024-04-27 23:23:42 +00:00
|
|
|
# OpenBikeSensor Portal
|
|
|
|
|
|
|
|
## Docker Containers
|
|
|
|
* 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.
|
|
|
|
|
2024-04-27 23:23:42 +00:00
|
|
|
```
|
|
|
|
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-27 23:23:42 +00:00
|
|
|
```
|
2024-04-28 00:01:34 +00:00
|
|
|
docker exec -ti --user postgres obs-portal-db pg_dump obs > dump.sql
|
2024-04-27 23:23:42 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## 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.
|
|
|
|
|
2024-04-27 23:23:42 +00:00
|
|
|
```
|
|
|
|
cat dump.sql | docker exec -ti --user postgres obs-portal-db psql obs
|
|
|
|
```
|