Comme indiquée dans la documentation de GeoNature : La mise à jour de GeoNature consiste à télécharger sa nouvelle version dans un nouveau répertoire, récupérer les fichiers de configuration et de surcouche depuis la version actuelle et de relancer l’installation dans le répertoire de la nouvelle version.
sudo systemctl stop postgresqlsudo systemctl start postgresqlmv ~/www/maintenance/geonature/maintenance.disable ~/www/maintenance/geonature/maintenance.enable
systemctl stop geonature taxhub usershub atlas
nginx_dissite geonature.conf ; nginx_ensite geonature_maintenance.conf ; service nginx reloadnginx_dissite atlas.conf ; nginx_ensite atlas_maintenance.conf ; service nginx reloadsupervisorctl stop geonature2 atlas taxhub usershub2 export GNV=$(curl -s https://api.github.com/repos/PnX-SI/GeoNature/releases/latest | grep tag_name | cut -d\" -f4) echo "${GNV}" * cd ~/dwl/ wget https://github.com/PnX-SI/GeoNature/archive/${GNV}.zip -O geonature_v${GNV}.zip unzip geonature_v${GNV}.zip -d ./mv GeoNature-${GNV} ~/www/geonature_v${GNV}cd ~/www/cd ~/www; rm -f geonature_old; ln -s geonature_v<ancienne-version> geonature_oldcd ~/; rm -f geonature_old; ln -s ~/www/geonature_old geonature_oldcd ~/; rm -f geonature; ln -s ~/www/geonature geonaturecp ~/www/geonature_old/config/settings.ini ~/www/geonature_v${GNV}/config/settings.inicp ~/www/geonature_old/config/geonature_config.toml ~/www/geonature_v${GNV}/config/geonature_config.tomlvi ~/www/geonature_v${GNV}/backend/gunicorn_start.sh diff ~/www/geonature_old/config/settings.ini.sample ~/www/geonature_v${GNV}/config/settings.ini.sample diff ~/www/geonature_old/config/geonature_config.toml.sample ~/www/geonature_v${GNV}/config/geonature_config.toml.sample cd ~/www; rm -f geonature; ln -s geonature_v${GNV} geonature export UHV=$(curl -s https://api.github.com/repos/PnX-SI/UsersHub/releases/latest | grep tag_name | cut -d\" -f4) echo "${UHV}"cd ~/dwl/ wget https://github.com/PnX-SI/UsersHub/archive/${UHV}.zip -O usershub_v${UHV}.zip unzip usershub_v${UHV}.zip -d ~/www/cd ~/www/mv UsersHub-${UHV} usershub_v${UHV}cd ~/www; rm -f usershub_old; ln -s usershub_v<ancienne-version> usershub_oldcd ~/; rm -f usershub; ln -s ~/www/usershub usershubcd ~/; rm -f usershub_old; ln -s ~/www/usershub_old usershub_oldcp ~/www/usershub_old/config/settings.ini ~/www/usershub_v${UHV}/config/settings.inicp ~/www/usershub_old/config/config.py ~/www/usershub_v${UHV}/config/config.py diff ~/www/usershub_old/config/config.py.sample ~/www/usershub_v${UHV}/config/config.py.sample diff ~/www/usershub_old/config/settings.ini.sample ~/www/usershub_v${UHV}/config/settings.ini.sample cd ~/www; rm -f usershub; ln -s usershub_v${UHV} usershub export THV=$(curl -s https://api.github.com/repos/PnX-SI/TaxHub/releases/latest | grep tag_name | cut -d\" -f4) echo "${THV}"cd ~/dwl/ wget https://github.com/PnX-SI/TaxHub/archive/${THV}.zip -O taxhub_v${THV}.zip unzip taxhub_v${THV}.zip -d ~/www/cd ~/www/mv TaxHub-${THV} taxhub_v${THV}cd ~/www; rm -f taxhub_old; ln -s taxhub_v<ancienne-version> taxhub_oldcd ~/; rm -f taxhub; ln -s ~/www/taxhub taxhubcd ~/; rm -f taxhub_old; ln -s ~/www/taxhub_old taxhub_oldcp ~/www/taxhub_old/settings.ini ~/www/taxhub_v${THV}/settings.inicp ~/www/taxhub_old/config.py ~/www/taxhub_v${THV}/config.pycp ~/www/taxhub_old/static/app/constants.js ~/www/taxhub_v${THV}/static/app/constants.jscp -aR ~/www/taxhub_old/static/medias/ ~/www/taxhub_v${THV}/static/medias/ diff ~/www/taxhub_old/config.py.sample ~/www/taxhub_v${THV}/config.py.sample diff ~/www/taxhub_old/settings.ini.sample ~/www/taxhub_v${THV}/settings.ini.sample diff ~/www/taxhub_old/static/app/constants.js.sample ~/www/taxhub_v${THV}/static/app/constants.js.sample cd ~/www; rm -f taxhub; ln -s taxhub_v${THV} taxhubrsync -av -e "ssh -p <port-ssh-db>" /home/geonat/www/ geonat@db-<region>-sinp:/home/geonat/www/ssh geonat@db-<region>-sinpcd ~/; rm -f geonature_old; ln -s ~/www/geonature_old geonature_oldcd ~/; rm -f geonature; ln -s ~/www/geonature geonaturecd ~/; rm -f usershub; ln -s ~/www/usershub usershubcd ~/; rm -f usershub_old; ln -s ~/www/usershub_old usershub_oldcd ~/; rm -f taxhub; ln -s ~/www/taxhub taxhubcd ~/; rm -f taxhub_old; ln -s ~/www/taxhub_old taxhub_old export GNV=$(curl -s https://api.github.com/repos/PnX-SI/GeoNature/releases/latest | grep tag_name | cut -d\" -f4) export UHV=$(curl -s https://api.github.com/repos/PnX-SI/UsersHub/releases/latest | grep tag_name | cut -d\" -f4) export THV=$(curl -s https://api.github.com/repos/PnX-SI/TaxHub/releases/latest | grep tag_name | cut -d\" -f4) echo "GNV: ${GNV} ; UHV: ${UHV} ; THV: ${THV}" supervisorctl start geonature2 atlas taxhub usershub2nginx_dissite geonature_maintenance.conf ; nginx_ensite geonature.conf ; service nginx reloadnginx_dissite atlas_maintenance.conf ; nginx_ensite atlas.conf ; service nginx reloadLors de la phase de développement de nouvelle fonctionnalités sur GeoNature, il peut être intéressant de pouvoir les tester en ligne. Pour ce faire, il est important que la branche en question se base sur la dernière version installée sur le serveur de GeoNature. Sinon, il risque d'y avoir des problème de compatibilité avec la base de données. ATTENTION : Si la branche nécessite une mise à jour de la base de données, bien vérifier que cette mise à jour est réversible !
Voici la procédure à suivre pour mettre en place un telle branche sur "web-srv" :
export GNB="<branche>" cat VERSION export GNV="2.10.0.dev0-5208519" ~/www/geonature/backend/venv/lib/python3.7/site-packages/utils_flask_sqla. Cela ne devrait plus être nécessaire avec les versions 2.8.2+ car les dépendances sont inclues via pip install -r requirementsecho "Branche: ${GNB} ; GeoNature : ${GNV}"cd ~/dwl/ wget https://github.com/PnX-SI/GeoNature/archive/<branche>.zip -O "geonature_${GNB}_v${GNV}.zip" https://github.com/PnX-SI/GeoNature/archive/<sha1>.zip unzip geonature_${GNB}_v${GNV}.zip -d ~/dwl/mv GeoNature-${GNB} geonature_${GNB}_v${GNV} mv geonature_${GNB}_v${GNV} ~/www/ cd ~/www/ cp ~/www/geonature/config/settings.ini ~/www/geonature_${GNB}_v${GNV}/config/settings.ini cp ~/www/geonature/config/geonature_config.toml ~/www/geonature_${GNB}_v${GNV}/config/geonature_config.toml environ de paramétrage : cp ~/www/geonature/environ ~/www/geonature_${GNB}_v${GNV}/environ cp ~/www/geonature/backend/gunicorn_start.sh ~/www/geonature_${GNB}_v${GNV}/backend/gunicorn_start.sh diff ~/www/geonature/config/settings.ini.sample ~/www/geonature_${GNB}_v${GNV}/config/settings.ini.sample diff ~/www/geonature/config/geonature_config.toml.sample ~/www/geonature_${GNB}_v${GNV}/config/geonature_config.toml.sample vi ~/www/geonature_${GNB}_v${GNV}/config/settings.ini vi ~/www/geonature_${GNB}_v${GNV}/config/geonature_config.toml mv ~/www/geonature_${GNB}_v${GNV}/frontend/src/custom ~/www/geonature_${GNB}_v${GNV}/frontend/src/custom.savemkdir ~/www/geonature_${GNB}_v${GNV}/frontend/src/custom/ cp -r ~/geonature/frontend/src/custom/* ~/www/geonature_${GNB}_v${GNV}/frontend/src/custom/ cd ~/www/geonature_${GNB}_v${GNV}/frontend/src ; diff -qr custom.save/ custom/export avec : cp -r ~/geonature/backend/static/exports/* ~/www/geonature_${GNB}_v${GNV}/backend/static/exports cp ~/geonature/frontend/src/favicon.ico ~/www/geonature_${GNB}_v${GNV}/frontend/src/favicon.ico cp ~/www/geonature_old/frontend/node_modules/leaflet-draw/dist/leaflet.draw.js ~/www/geonature/frontend/node_modules/leaflet-draw/dist/leaflet.draw.jscd ~/www; rm -f geonature; ln -s geonature_${GNB}_v${GNV} geonaturecd ~/www; rm -f geonature_old; ln -s geonature_v${GNV} geonature_oldcd ~/www; rm -f geonature_old; ln -s geonature_${GNB}_v<ancienne-version> geonature_oldfalse le paramètre drop_apps_db du fichier ~/www/geonature_${GNB}_v${GNV}/config/settings.ini si vous l'avez modifié !geonature db statusgeonature db autoupgradersync -av -e "ssh -p <port-ssh-db>" /home/geonat/www/ geonat@db-<region>-sinp:/home/geonat/www/psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/<mon-fichier-de-mise-a-jour>.sql sudo chmod o+x /usr/bin/gcc mkdir -p /home/${USER}/geonature/var/log/gn_export/ ; touch /home/${USER}/geonature/var/log/gn_export/cron.log cd ~/www/geonature/ ; ./install/migration/migration.sh sudo chmod o-x /usr/bin/gcc false le paramètre drop_apps_db du fichier ~/www/geonature_${GNB}_v${GNV}/config/settings.ini si vous l'avez modifié ! sudo systemctl status geonature sudo supervisorctl status geonature2 Toutes étapes suivantes se déroulent sur "web-srv" à l'exception des mises à jour de la base sur "db-srv" :
export UHB="<branche>" cat VERSION export UHV="2.2.2-0580563" echo "Branche: ${UHB} ; UsersHub : ${UHV}"cd ~/dwl/ wget https://github.com/PnX-SI/UsersHub/archive/<branche>.zip -O "usershub_${UHB}_v${UHV}.zip" https://github.com/PnX-SI/UsersHub/archive/<sha1>.zip unzip usershub_${UHB}_v${UHV}.zip -d ~/dwl/mv UsersHub-${UHB} usershub_${UHB}_v${UHV} mv usershub_${UHB}_v${UHV} ~/www/ cd ~/www/cp ~/www/usershub/config/settings.ini ~/www/usershub_${UHB}_v${UHV}/config/settings.inicp ~/www/usershub/config/config.py ~/www/usershub_${UHB}_v${UHV}/config/config.py diff ~/www/usershub/config/config.py.sample ~/www/usershub_${UHB}_v${UHV}/config/config.py.sample diff ~/www/usershub/config/settings.ini.sample ~/www/usershub_${UHB}_v${UHV}/config/settings.ini.sample vi ~/www/usershub_${UHB}_v${UHV}/config/config.py vi ~/www/usershub_${UHB}_v${UHV}/config/settings.ini cd ~/www; rm -f usershub; ln -s usershub_${UHB}_v${UHV} usershubcd ~/www; rm -f usershub_old; ln -s usershub_v${UHV} usershub_oldcd ~/www; rm -f usershub_old; ln -s usershub_${UHB}_v<ancienne-version> usershub_oldgeonature depuis la version 2.9.0, voir cet étape dans la section consacré à GeoNature.Toutes étapes suivantes se déroulent sur "web-srv" à l'exception des mises à jour de la base sur "db-srv" :
export THB="<branche>" cat VERSION export THV="1.9.4-0580563" echo "Branche: ${THB} ; TaxHub : ${THV}" cd ~/dwl/ wget https://github.com/PnX-SI/TaxHub/archive/<branche>.zip -O "taxhub_${THB}_v${THV}.zip" https://github.com/PnX-SI/TaxHub/archive/<sha1>.zip unzip taxhub_${THB}_v${THV}.zip -d ~/dwl/mv TaxHub-${THB} taxhub_${THB}_v${THV} mv taxhub_${THB}_v${THV} ~/www/ cd ~/www/cp ~/www/taxhub/settings.ini ~/www/taxhub_${THB}_v${THV}/settings.inicp ~/www/taxhub/apptax/config.py ~/www/taxhub_${THB}_v${THV}/apptax/config.pycp ~/www/taxhub/config.py ~/www/taxhub_${THB}_v${THV}/config.pycp ~/www/taxhub/static/app/constants.js ~/www/taxhub_${THB}_v${THV}/static/app/constants.jscp -aR ~/www/taxhub/static/medias/ ~/www/taxhub_${THB}_v${THV}/static/medias/ diff ~/www/taxhub/apptax/config.py.sample ~/www/taxhub_${THB}_v${THV}/apptax/config.py.sample diff ~/www/taxhub/config.py.sample ~/www/taxhub_${THB}_v${THV}/config.py.sample diff ~/www/taxhub/settings.ini.sample ~/www/taxhub_${THB}_v${THV}/settings.ini.sample diff ~/www/taxhub/static/app/constants.js.sample ~/www/taxhub_${THB}_v${THV}/static/app/constants.js.sample vi ~/www/taxhub_${THB}_v${THV}/config.py vi ~/www/taxhub_${THB}_v${THV}/settings.ini vi ~/www/taxhub_${THB}_v${THV}/static/app/constants.js cd ~/www; rm -f taxhub; ln -s taxhub_${THB}_v${THV} taxhubcd ~/www; rm -f taxhub_old; ln -s taxhub_v${THV} taxhub_oldcd ~/www; rm -f taxhub_old; ln -s taxhub_${THB}_v<ancienne-version> taxhub_oldgeonature depuis la version 2.9.0, voir cet étape dans la section consacré à GeoNature.Passage à Systemd :
install/assets/geonature.service dans /etc/systemd/system/ : sudo cp ~/www/geonature_${GNB}_v${GNV}/install/assets/geonature.service /etc/systemd/system /etc/systemd/system/geonature.service et remplacer les variables ${USER} (votre utilisateur linux courant) et ${BASE_DIR} (chemin absolu du répertoire de GeoNature) par les valeurs appropriéesenviron à la racine de votre dossier GeoNature, et indiquer les variables d’environnement avec les valeurs modifiées : GUNICORN_NUM_WORKERS=9 GUNICORN_TIMEOUT=300
config/settings.ini de GeoNature.sudo systemctl daemon-reloadsudo systemctl start geonaturesudo systemctl enable geonatureSurcoucher le service Systemd de GeoNature :
systemctl edit geonature [Unit] StartLimitIntervalSec=60min StartLimitBurst=25 [Service] ExecStart= ExecStart=/home/geonat/www/geonature/backend/venv/bin/gunicorn geonature:create_app() \ --statsd-host "localhost:8125" \ --statsd-prefix "geonature" \ --name "${GUNICORN_PROC_NAME}" --workers "${GUNICORN_NUM_WORKERS}" \ --bind "${GUNICORN_HOST}:${GUNICORN_PORT}" --timeout="${GUNICORN_TIMEOUT}" Restart=on-failure RestartSec=2min StandardOutput=append:/var/log/geonature/geonature.log
vi /etc/systemd/system/geonature.service.d/override.conf systemctl daemon-reload systemctl restart geonature Surcoucher le service Systemd de TaxHub :
systemctl edit taxhub [Unit] StartLimitIntervalSec=60min StartLimitBurst=25 [Service] ExecStart= ExecStart=/home/geonat/www/taxhub/venv/bin/gunicorn apptax.app:create_app() \ --statsd-host "localhost:8125" \ --statsd-prefix "taxhub" \ --name "${GUNICORN_PROC_NAME}" --workers "${GUNICORN_NUM_WORKERS}" \ --bind "${GUNICORN_HOST}:${GUNICORN_PORT}" --timeout="${GUNICORN_TIMEOUT}" Restart=on-failure RestartSec=2min StandardOutput=append:/var/log/taxhub/taxhub.log
vi /etc/systemd/system/taxhub.service.d/override.conf systemctl daemon-reload systemctl restart taxhub Surcoucher le service Systemd de UsersHub :
systemctl edit usershub [Unit] StartLimitIntervalSec=60min StartLimitBurst=25 [Service] ExecStart= ExecStart=/home/geonat/www/usershub/venv/bin/gunicorn app.app:create_app() \ --statsd-host "localhost:8125" \ --statsd-prefix "usershub" \ --name "${GUNICORN_PROC_NAME}" --workers "${GUNICORN_NUM_WORKERS}" \ --bind "${GUNICORN_HOST}:${GUNICORN_PORT}" --timeout="${GUNICORN_TIMEOUT}" Restart=on-failure RestartSec=2min StandardOutput=append:/var/log/usershub/usershub.log
vi /etc/systemd/system/usershub.service.d/override.conf systemctl daemon-reload systemctl restart usershub
Ajout des options --statsd-* :
exec gunicorn wsgi:app \ --statsd-host=localhost:8125 \ --statsd-prefix=geonature \ --timeout ${gun_timeout} \ --error-log $APP_DIR/var/log/gn_errors.log \ --pid="${app_name}.pid" \ -w "${gun_num_workers}" \ -b "${gun_host}:${gun_port}" \ -n "${app_name}"
sudo supervisorctl stop geonature2 sudo rm /etc/supervisor/conf.d/geonature-service.conf sudo vi /etc/nginx/sites-available/geonature.conf proxy_pass http://127.0.0.1:8000/; par proxy_pass http://127.0.0.1:8000/api/; nginx-reload config/geonature_config.toml en :[ALEMBIC] VERSION_LOCATIONS = "/home/geonat/www/usershub/app/migrations/versions/"
id_type par des type_code dans le paramètre AREA_FILTERS. Par exemple, l'id 25 devient "COM". id_type par des type_code dans le paramètre AREA_TYPES. Ex. : AREA_TYPES = ["COM", "DEP", "SINP"] cd install/ ./01_install_backend.sh source backend/venv/bin/activate geonature db stamp f06cc80cc8ba geonature db stamp 0dfdbfbccd63 geonature db stamp 3fdaa1805575 geonature db stamp 586613e2faeb geonature db stamp 7d6e98441e4c geonature db stamp ede150d9afd9 psql -h localhost -U geonatadmin -d geonature2db -c "DELETE FROM gn_sensitivity.cor_sensitivity_criteria WHERE id_criteria IS NULL;" geonature db status chercher la révision sur la brance [geonature] qui précède 3b2f3de760dc access request. geonature db upgrade ca052245c6ec -x recompute-sensitivity=false -x restore-diffusion-level=false geonature db stamp c9854947fa23 # data-blurring geonature db upgrade geonature@head geonature db status geonature db upgrade habitats_inpn_data@head geonature db upgrade nomenclatures@head geonature db upgrade taxonomie@head cd ~/geonature/frontend/ nvm install nvm use cd ~/geonature/install/ ./04_install_frontend.sh cd ~/geonature/frontend npm i -D @angular-builders/custom-webpack npm run build geonature db stamp ad35a3bf85c2geonature db upgrade taxonomie_inpn_data@head sudo systemctl restart geonature sudo aptitude remove supervisor psql -h localhost -U geonatadmin -d geonature2db -f ~/data/db-geonature/data/sql/04_* psql -h localhost -U geonatadmin -d geonature2db -f ~/data/db-geonature/data/sql/01_fix_v_synthese_for_export.sql psql -h localhost -U geonatadmin -d geonature2db -f ~/data/cenpaca/data/sql/fix/006_* mv ~/geonature/frontend/src/custom/custom.scss ~/geonature/frontend/src/assets/custom.css psql -h localhost -U geonatadmin -d geonature2db -f "data/migrations/2.6.2to2.7.0.sql" rsync -av ./ geonat@db-paca-sinp:~/data/db-geonature/ --dry-run supprimer –dry-run si tout est ok psql -h localhost -U geonatadmin -d geonature2db -f ~/data/db-geonature/data/sql/01_fix_v_synthese_for_export.sql psql -h localhost -U geonatadmin -d geonature2db -f "data/migrations/2.7.1to2.7.2.sql" psql -h localhost -U geonatadmin -d gn2_dev_sinp -f "data/update1.7.3to1.8.0.sql"
Loose attributes and medium now attach to … et "Conflict …" pour lesquels il peut y avoir une action à mener si des attributs (att_nb) ou des media existent (media_nb).psql -h localhost -U geonatadmin -d gn2_dev_sinp -f "data/migrations/2.6.2to2.7.0.sql"
frontend/src/assets/custom.csspsql -h localhost -U geonatadmin -d gn2_dev_sinp -f "data/migrations/2.7.1to2.7.2.sql"
cd ~/geonature mkdir tmp vi tmp/2.6.0-rc.1to2.6.0.sql : placer dedans toutes les lignes du script de migration situé après la ligne 471 indiquant "---- AFTER 2.6.0.rc.1". Penser à rajouter un BEGIN; au début du fichier. wget https://raw.githubusercontent.com/PnX-SI/Nomenclature-api-module/master/data/update1.3.4to1.3.5.sql -O tmp/nomenclature-api-module_update1.3.4to1.3.5.sql wget https://raw.githubusercontent.com/PnX-SI/Nomenclature-api-module/master/data/update1.3.4to1.3.5.sql -O tmp/nomenclature-api-module_update1.3.5to1.3.6.sql psql -h localhost -U geonatadmin -d geonature2db -f ./tmp/2.6.0-rc.1to2.6.0.sql sudo -u postgres psql -d geonature2db -c "UPDATE pg_attribute SET atttypmod = 5004 WHERE attrelid = 'gn_synthese.synthese'::regclass AND attname = 'reference_biblio';" psql -h localhost -U geonatadmin -d geonature2db -f ./tmp/nomenclature-api-module_update1.3.4to1.3.5.sql psql -h localhost -U geonatadmin -d geonature2db -f ./tmp/nomenclature-api-module_update1.3.5to1.3.6.sql psql -h localhost -U geonatadmin -d geonature2db -f ./data/migrations/2.6.0to2.6.1.sql psql -h localhost -U geonatadmin -d geonature2db -f ./data/migrations/access_request.sql psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/2.5.5to2.6.0_maj_jpm_2021-01-14.sql : ce fichier 2.5.5to2.6.0_maj_jpm_2021-01-14.sql contient toutes les lignes du fichier 2.5.5to2.6.0.sql du début du fichier jusqu'à la ligne de commentaire —- AFTER 2.5.6.rc.2.cp ~/geonature_old/backend/venv/lib/python3.7/site-packages/utils_flask_sqla/response.py ~/geonature/backend/venv/lib/python3.7/site-packages/utils_flask_sqla/response.py cd ~/www/geonature/data/migrations ; wget https://raw.githubusercontent.com/PnX-SI/Nomenclature-api-module/master/data/update1.3.2to1.3.3.sql -O nomenclature-api-module_update1.3.2to1.3.3.sql psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/nomenclature-api-module_update1.3.2to1.3.3.sql psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/2.3.2to2.4.0.sql DELETE FROM gn_synthese.cor_area_synthese cas USING gn_synthese.synthese s, ref_geo.l_areas a WHERE cas.id_synthese = s.id_synthese AND a.id_area = cas.id_area AND public.ST_TOUCHES(s.the_geom_local,a.geom); n'a pas été exécuté… Voir ticket #719. psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/2.4.0to2.4.1.sql mkdir ~/www/geonature/var/log/ cd ~/www/geonature/data/migrations/ ; ./2.4.0to2.4.1_insert_departments.sh cd ~/www/geonature/data/migrations ; wget https://raw.githubusercontent.com/PnX-SI/Nomenclature-api-module/master/data/update1.3.3to1.3.4.sql -O nomenclature-api-module_update1.3.3to1.3.4.sql psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/nomenclature-api-module_update1.3.3to1.3.4.sql gn_exports.v_synthese_sinp puis supprimer cette vue. psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/2.4.1to2.5.0.sql gn_exports.v_synthese_sinp en effectuant au préalable des corrections dedans : supprimer le champ id_nomenclature_obs_technique et renommer le champ id_nomenclature_obs_meth ⇒ id_nomenclature_obs_technique, remplacer le label "obsMeth" par "obsTech". psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/2.5.1to2.5.2.sql psql -h localhost -U geonatadmin -d geonature2db -f ~/geonature/data/migrations/2.5.2to2.5.3.sql sudo aptitude install libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info mkdir -p /home/${USER}/geonature/var/log/gn_export/ ; touch /home/${USER}/geonature/var/log/gn_export/cron.log sudo chmod o+x /usr/bin/gcc : réactiver GCC le temps de l'install du venv Python (⇒ compilation Psycopg2) cd ~/www/geonature/ ; ./install/migration/migration.sh sudo chmod o-x /usr/bin/gcc sudo supervisorctl status geonature2 geonature install_gn_module /home/geonat/www/geonature/contrib/gn_module_occhab /occhabocchab en suivant la procédure. sudo supervisorctl stop usershub2 sudo rm /etc/supervisor/conf.d/usershub-service.conf sudo aptitude install python3-venv config/config.py le paramètre URLS_COR, il n'est plus utilisé../install_app.sh vi /etc/systemd/system/usershub.service geonature via Alembic. Il est donc nécessaire de mettre à jour GeoNature en v2.10.0.dev0. geonature db upgrade usershub@head psql -h localhost -U geonatadmin -d geonature2db -f ~/usershub/data/update_2.1.0to2.1.1.sql psql -h localhost -U admin -d geonature2db -c "UPDATE pg_attribute SET atttypmod = 500+4 WHERE attrelid = 'utilisateurs.bib_organismes'::regclass AND attname = 'nom_organisme';" psql -h localhost -U geonatadmin -d geonature2db -f ~/usershub/data/update_2.1.2to2.1.3.sql sudo aptitude install python3-pip sudo pip3 install virtualenv==20.0.1 sudo chmod o+x /usr/bin/gcc : réactiver GCC le temps de l'install du venv Python (⇒ compilation Psycopg2) cd ~/www/usershub/ ; rm -fR venv ; ./install_app.sh sudo chmod o-x /usr/bin/gcc sudo supervisorctl status usershub sudo supervisorctl stop taxhub sudo rm /etc/supervisor/conf.d/taxhub-service.conf sudo aptitude install python3-venv cd ~/taxhub mv config.py apptax/ apptax/config.py ainsi :# File import os BASE_DIR = os.path.abspath(os.path.dirname(__file__))
UPLOAD_FOLDER = 'static/medias' par UPLOAD_FOLDER = 'medias' ./install_app.sh vi /etc/systemd/system/taxhub.service cd ~/www/taxhub/ source venv/bin/activate export FLASK_APP=apptax/app.py flask taxref_migration import_taxref_v15 wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v15/sql/2.1_taxref_changes_corrections_pre_detections.sql -O apptax/migrations/data/migrate_taxref_version/2.1_taxref_changes_corrections_pre_detections.sql wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v15/sql/2.2_taxref_changes_corrections_post_detections.sql -O apptax/migrations/data/migrate_taxref_version/2.2_taxref_changes_corrections_post_detections.sql flask taxref_migration apply_changes --script_predetection /home/geonat/www/taxhub/apptax/migrations/data/migrate_taxref_version/2.1_taxref_changes_corrections_pre_detections.sql --script_postdetection /home/geonat/www/taxhub/apptax/migrations/data/migrate_taxref_version/2.2_taxref_changes_corrections_post_detections.sql geonature db stamp ad35a3bf85c2 cd ~/www/taxhub_feat-sinp_v1.9.4-0580563/ sudo -u postgres -s psql -d geonature2db -c 'CREATE EXTENSION IF NOT EXISTS "unaccent";' psql -h localhost -U geonatadmin -d geonature2db -f "data/update1.7.3to1.8.0.sql" cd data/scripts/update_taxref/ sudo ls ./import_taxref_v13_data.sh wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v13/data/sql/2.1_taxref_changes_corrections_pre_detections.sql -O scripts/2.1_taxref_changes_corrections_pre_detections.sql wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v13/data/sql/2.2_taxref_changes_corrections_post_detections.sql -O scripts/2.2_taxref_changes_corrections_post_detections.sql wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v13/data/sql/4.3_restore_local_constraints.sql -O scripts/4.3_restore_local_constraints.sql ./apply_changes.sh 13 ./clean_db.sh sudo ls ./import_taxref_v14.sh wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v14/data/sql/2.1_taxref_changes_corrections_pre_detections.sql -O scripts/2.1_taxref_changes_corrections_pre_detections.sql wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v14/data/sql/2.2_taxref_changes_corrections_post_detections.sql -O scripts/2.2_taxref_changes_corrections_post_detections.sql wget https://raw.githubusercontent.com/cbn-alpin/sinp-paca-data/master/taxref/v14/data/sql/4.3_restore_local_constraints.sql -O scripts/4.3_restore_local_constraints.sql ./apply_changes.sh 14 ./clean_db.sh geonature via Alembic. Il est donc nécessaire de mettre à jour GeoNature en v2.10.0.dev0. geonature db upgrade taxonomie@head sudo psql -h localhost -U geonatadmin -d geonature2db -f ~/taxhub/data/update1.6.3to1.6.4.sql vi ~/www/taxhub/static/app/constants.js ⇒ supprimer la ligne contenant id_application. sudo psql -h localhost -U geonatadmin -d geonature2db -f ~/taxhub/data/update1.6.5to1.7.0.sql sudo psql -h localhost -U geonatadmin -d geonature2db -f ~/taxhub/data/update1.7.1to1.7.2.sql vi ~/www/taxhub/static/app/constants.js ⇒ supprimer la ligne contenant id_application. sudo chmod o+x /usr/bin/gcc : réactiver GCC le temps de l'install du venv Python (⇒ compilation Psycopg2) cd ~/www/taxhub/ ; rm -fR venv ; ./install_app.sh sudo chmod o-x /usr/bin/gcc sudo supervisorctl status taxhub