Listes des étapes à suivre après une intégration de données (Gn2Pg ou via scripts).
Pour AURA, le script de maintenance automatisé doit se charger de réaliser toutes les étapes indiquées ci-dessous.
cd ~/data/area-outside/data/sql/update/ psql -h localhost -U geonatadmin -d geonature2db -f ./01_* ./02_load_admin_areas.sh geonature2db sudo apt install git-lfsgit lfs installgit lfs pull ./02_load_meshes.sh geonature2db psql -h localhost -U geonatadmin -d geonature2db -f ./03_insert_admin_areas* psql -h localhost -U geonatadmin -d geonature2db -f ./03_insert_meshes* psql -h localhost -U geonatadmin -d geonature2db -f ./04_after_insert_admin_areas*psql -h localhost -U geonatadmin -d geonature2db -f ./04_after_insert_meshes*psql -h localhost -U geonatadmin -d geonature2db -f ./05_*tmp_outside_* et tmp_outside_after_*, il devrait y avoir moins d'observations dans les tables *_after_*. psql -h localhost -U geonatadmin -d geonature2db -f ./06_*~/data/area-outside/data/sql : 01_create_outside_all.sql : pour créer la table contenant toutes les observations hors territoire 03_fix_outside_geom.sql : pour mettre à NULL toutes les géométries des observations hors territoire.db-srv :taxonomie.bib_noms avec les éventuels nouveaux noms présents dans la synthèse : psql -h localhost -U geonatadmin -d geonature2db -c "INSERT INTO taxonomie.bib_noms (cd_nom, cd_ref) SELECT DISTINCT s.cd_nom, t.cd_ref FROM gn_synthese.synthese AS s JOIN taxonomie.taxref AS t ON s.cd_nom = t.cd_nom WHERE NOT s.cd_nom IN (SELECT DISTINCT cd_nom FROM taxonomie.bib_noms); " web-srv :cd ~/www/taxhub/data/scripts/import_inpn_mediasource venv/bin/activatepython import_inpn_media.pytaxonomie.t_medias.deactivateset_first_img.sql (recommandé) sur serveur db-srv dans ~/data/maintenance/data/sql/ avec : psql -h localhost -U geonatadmin -d geonature2db -f ./set_first_img.sqlpsql -h localhost -U geonatadmin -d geonature2db -c "WITH first_media AS (SELECT MIN(id_media) AS first_id_media_founded, cd_ref FROM taxonomie.t_medias GROUP BY cd_ref) UPDATE taxonomie.t_medias AS tm SET id_type = 1 FROM first_media AS fm WHERE tm.id_media = fm.first_id_media_founded AND tm.cd_ref = fm.cd_ref ;"db-srv : df -h |grep /dev/sda1 ; du -hs /var/lib/postgresql/
psql -h localhost -U geonatadmin -d geonature2db -f ~/data/shared/data/sql/synthese_maintenance.sql
web-srv : ssh geonat@web-<region>-sinp
screen -S gn-update-profiles
cd ~/geonature ; source backend/venv/bin/activate
geonature profiles update
deactivate
Ctrl-a + Ctrl-dF12 pour ouvir les outils développeurs du navigateurhomePage.statsF5web-srv : mv ~/www/maintenance/atlas/maintenance.disable ~/www/maintenance/atlas/maintenance.enable db-srv : screen -S atlas-update
cd ~/data/maintenance/data/sql/
psql -h localhost -U geonatadmin -d gnatlas -f ./atlas_refresh.sql
Ctrl-a + Ctrl-dweb-srv : mv ~/www/maintenance/atlas/maintenance.enable ~/www/maintenance/atlas/maintenance.disable sudo systemctl restart geonature-atlas.serviceindicators/ du dépôt sinp-<region>-data avec : cd /<path>/sinp-paca-data/extracts/indicators
cat ./observations_count_by_imports.sql | ssh geonat@db-paca-sinp 'export PGPASSWORD="<db-user-pwd>" ; psql -q -h localhost -p 5432 -U gnreader -d geonature2db' > ./$(date +'%F')_obs_by_imports.csv