From 05a50ae567667df427056a7650ccc69e115e3121 Mon Sep 17 00:00:00 2001 From: Chatewgne Date: Thu, 23 Jan 2025 10:43:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20[DOC]=20Fix=20install=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.rst | 6 ++++++ docs/install/import.rst | 10 ---------- docs/install/installation.rst | 2 +- docs/install/upgrade.rst | 22 ++++++++++++++++++---- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 1d882b78d8..750ceb9e14 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,12 @@ CHANGELOG 2.111.0+dev (XXXX-XX-XX) ---------------------------- +**Breaking changes** + +This version uses pgRouting. You need to install this extension in your database before upgrading to this version. See : + +https://geotrek.readthedocs.io/en/latest/install/upgrade.html#from-geotrek-admin-2-112-0 + **Warnings** - When adding a via-point to a linear object's topology, it is now required to drop the new marker onto a path before the updated route is displayed, as the preview is no longer available when dragging the marker. This is due to the route computation now being performed on the backend. For more information, see https://github.com/GeotrekCE/Geotrek-admin/issues/4286 diff --git a/docs/install/import.rst b/docs/install/import.rst index 4c1e60728e..5f993e0e4f 100644 --- a/docs/install/import.rst +++ b/docs/install/import.rst @@ -143,16 +143,6 @@ After importing a large quantity of paths, it is recommended to pre-generate the paths graph needed for the routing. This action is not mandatory, but will reduce the time needed for the first routing following the import. -To pre-generate the graph, use the ``generate_pgr_network_topology`` command:: - - sudo geotrek generate_pgr_network_topology - OR - docker compose run --rm web ./manage.py generate_pgr_network_topology - -After importing a large quantity of paths, it is recommended to pre-generate the -paths graph needed for the routing. This action is not mandatory, but will reduce the time needed for the first -routing following the import. - To pre-generate the graph, use the ``generate_pgr_network_topology`` command:: sudo geotrek generate_pgr_network_topology diff --git a/docs/install/installation.rst b/docs/install/installation.rst index 7fdd719542..8f9b6a1388 100644 --- a/docs/install/installation.rst +++ b/docs/install/installation.rst @@ -80,7 +80,7 @@ If you are not confident with the ``install.sh`` script, or if you are having tr 2. Add https://packages.geotrek.fr/geotrek.gpg.key to apt keyring. 3. Run ``apt-get update`` 4. If you want to use a local database, install the pgRouting package by running ``sudo apt install -y postgresql-pgrouting wget software-properties-common`` (before installing Geotrek-admin, not at the same time). - If not, you must create database and enable PostGIS and pgRouting extensions before. + If not, you must create database and enable PostGIS, pgRouting and pgcrypto extensions before. 5. Install the Geotrek-admin package (``sudo apt install geotrek-admin``). .. note :: diff --git a/docs/install/upgrade.rst b/docs/install/upgrade.rst index 51baa6e27b..e2442244fe 100644 --- a/docs/install/upgrade.rst +++ b/docs/install/upgrade.rst @@ -89,17 +89,31 @@ Make sure to run the following command **BEFORE** upgrading: ``su postgres -c "psql -q -d $POSTGRES_DB -c 'CREATE EXTENSION pgcrypto;'"`` -From Geotrek-admin <= 2.110.0 +From Geotrek-admin <= 2.112.0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **WARNING!** -Starting from version 2.111.0, Geotrek now requires pgRouting. Before upgrading: +Starting from version 2.113.0, Geotrek now requires pgRouting. Please follow these steps before updating. -1. Install the pgRouting package by running ``sudo apt install -y postgresql-pgrouting wget software-properties-common`` +**On a Debian installation :** -2. Run the following command: ``su postgres -c "psql -q -d $POSTGRES_DB -c 'CREATE EXTENSION pgrouting;'"`` +1. Backup your database : ``sudo -u postgres pg_dump --no-acl --no-owner -Fc $POSTGRES_DB > `date +%Y%m%d%H%M`-database.backup`` +2. Download and install the pgRouting package from the official website or using your distribution's package manager. + +3. Activate the extension in your database : ``su postgres -c "psql -q -d $POSTGRES_DB -c 'CREATE EXTENSION pgrouting;'"`` + +4. Update Geotrek as usual + + +**On a Docker installation :** + +1. Backup your database : ``docker compose run --rm web bash -c 'pg_dump --no-acl --no-owner -Fc -h postgres $POSTGRES_DB > `date +%Y%m%d%H%M`-database.backup'`` + +2. Replace the docker image in ``docker-compose.yml`` for service ``postgres`` with an image that includes PostgreSQL, PostGIS and pgRouting (`example with PostgreSQL 12, PostGIS 3.0 and pgRouting 3.0.0 `_). We highly recommend picking an image including the **same versions of PostgreSQL and PostGIS that you already use**. If you choose to pick later versions instead, you will need to delete your database, recreate it, and use ``pg_restore`` to restore the backup from step 1 (see ``Maintenance`` section). + +3. Update Geotrek as usual Server migration