From 75c7e2dcf5b742af5d85bb2efe4b07e653c0cd66 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 28 Apr 2024 01:23:42 +0200 Subject: [PATCH 1/2] docs: add rough documentation about obs-portal --- docs/obs-portal.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/obs-portal.md diff --git a/docs/obs-portal.md b/docs/obs-portal.md new file mode 100644 index 0000000..be4a274 --- /dev/null +++ b/docs/obs-portal.md @@ -0,0 +1,25 @@ +# OpenBikeSensor Portal + +## Docker Containers +* portal +* worker +* db + + +## Run database migrations + +``` +docker exec -ti obs-portal tools/upgrade.py +``` + +## Dump database + +``` +docker exec -ti --user postgres obs-portal-db pg_dump obs +``` + +## Restore database + +``` +cat dump.sql | docker exec -ti --user postgres obs-portal-db psql obs +``` From a278c178b0ec19bead19ed3a96aadf3dbafa1b9a Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 28 Apr 2024 02:01:34 +0200 Subject: [PATCH 2/2] docs: obs-portal: add prosaic sugar --- docs/obs-portal.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/obs-portal.md b/docs/obs-portal.md index be4a274..a0ab53d 100644 --- a/docs/obs-portal.md +++ b/docs/obs-portal.md @@ -8,18 +8,25 @@ ## Run database migrations +After an upgrade it is sometimes necessary to run database migrations or regenerate tiles. + ``` docker exec -ti obs-portal tools/upgrade.py ``` ## Dump database +Save database dump to `dump.sql` in the current working directory. + ``` -docker exec -ti --user postgres obs-portal-db pg_dump obs +docker exec -ti --user postgres obs-portal-db pg_dump obs > dump.sql ``` ## Restore database +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 ```