true
le paramètre drop_apps_db
du fichier ~/geonature/config/settings.ini
.~/geonature/install/
avec la commande : cd ~/geonature/install/
screen -S install-db
./install_db.sh
~/geonature/var/log/install_db.log
false
le paramètre drop_apps_db
du fichier ~/geonature/config/settings.ini
!git clone git@github.com:cbn-alpin/sinp-paca-data.git
rsync -av --copy-unsafe-links --exclude var --exclude .git --exclude .gitattributes --exclude .gitmodules --exclude .editorconfig --exclude .vscode --exclude .gitignore --exclude settings.ini --exclude "data/raw/*" --exclude venv --exclude .venv --exclude "import-parser/data/*" ./ geonat@db-paca-sinp:~/data/ --dry-run
--dry-run
si tout semble ok pour effectuer le transfert réelsudo chmod o+x /usr/bin/gcc
. Une fois l'installation terminée, retirer les à nouveau avec chmod o-x /usr/bin/gcc
.ssh geonat@db-paca-sinp
mkdir -p backups/data
mv data backups/data/$(date +%F)
mkdir data
id_nomenclature_sensitivity
et id_nomenclature_diffusion_level
gn_synthese.v_synthese_for_export
: CREATE OR REPLACE VIEW gn_synthese.v_synthese_for_export AS SELECT s.id_synthese, s.unique_id_sinp AS uuid_perm_sinp, s.unique_id_sinp_grp AS uuid_perm_grp_sinp, af.acquisition_framework_name AS ca_nom, d.id_dataset AS jdd_id, d.unique_dataset_id AS jdd_uuid, d.dataset_name AS jdd_nom, n21.label_default AS niveau_validation, s.validator AS validateur, s.observers AS observateurs, t.cd_ref, t.nom_valide, s.count_min AS nombre_min, s.count_max AS nombre_max, s.date_min::DATE AS date_debut, s.date_max::DATE AS date_fin, st_asgeojson(s.the_geom_4326) AS geojson_4326, st_asgeojson(s.the_geom_local) AS geojson_local, s."precision" AS precision_geographique, n9.label_default AS niveau_precision_diffusion, s.id_digitiser, s.id_nomenclature_sensitivity, s.id_nomenclature_diffusion_level FROM gn_synthese.synthese s JOIN taxonomie.taxref t ON t.cd_nom = s.cd_nom JOIN gn_meta.t_datasets d ON d.id_dataset = s.id_dataset JOIN gn_meta.t_acquisition_frameworks af ON d.id_acquisition_framework = af.id_acquisition_framework LEFT JOIN ref_nomenclatures.t_nomenclatures n9 ON s.id_nomenclature_diffusion_level = n9.id_nomenclature LEFT JOIN ref_nomenclatures.t_nomenclatures n21 ON s.id_nomenclature_valid_status = n21.id_nomenclature ;
gn_synthese.v_synthese_taxon_for_export_view
: CREATE OR REPLACE VIEW gn_synthese.v_synthese_taxon_for_export_view AS WITH s AS (SELECT DISTINCT cd_nom FROM gn_synthese.synthese ) SELECT REF.nom_valide, REF.cd_ref, REF.nom_vern, REF.group1_inpn, REF.group2_inpn, REF.regne, REF.phylum, REF.classe, REF.ordre, REF.famille, REF.id_rang FROM s JOIN taxonomie.taxref t ON s.cd_nom = t.cd_nom JOIN taxonomie.taxref REF ON t.cd_ref = REF.cd_nom;
Il est nécessaire d'ajouter dans le référentiel géographique de GeoNature le contour du territoire du SINP.
Pour ce faire, nous allons utiliser le script area
du dépôt "data" :
ssh geonat@db-paca-sinp
cd ~/data/area
cp config/settings.sample.ini config/settings.ini
vi config/settings.ini
screen -S import-area
cd bin/ ; ./initialize.sh -v
vi ../var/log/$(date +'%F')_imports.log
SELECT COUNT(*) FROM ref_geo.l_areas AS la JOIN ref_geo.bib_areas_types AS bat ON (la.id_type = bat.id_type) WHERE type_code = 'COM';
sudo -u postgres psql
\c geonature2db
ALTER TABLE taxonomie.taxref_bdc_statut OWNER TO geonatadmin; ALTER TABLE taxonomie.taxref_bdc_statut_type OWNER TO geonatadmin;
\q
observers
de la table gn_synthese.synthese
: CREATE INDEX i_synthese_observers ON gn_synthese.synthese USING btree (observers)
ssh geonat@db-paca-sinp
cd ~/data/cenpaca
cp config/settings.sample.ini config/settings.ini
vi config/settings.ini
screen -S import-cenpaca
cd bin/ ; ./import_initial.sh -v
ssh geonat@db-paca-sinp
cd ~/data/cbna-cbnmed
cp config/settings.sample.ini config/settings.ini
vi config/settings.ini
screen -S import-cbna-cbnmed
cd bin/ ; ./import_initial.sh -v
Suivre la démarche décrite dans la documentation de gestion des serveurs.