Bretagne-Vivante / GeoNature

Application de saisie et de synthèse des observations faune et flore
GNU General Public License v3.0
0 stars 0 forks source link

Update to taxref 17 #7

Open pierre56 opened 1 month ago

pierre56 commented 1 month ago

Update to taxref 17

DOC

https://github.com/PnX-SI/TaxHub/blob/master/apptax/taxonomie/commands/migrate_taxref/README.rst

https://demo.geonature.fr/taxhub/api/taxref/version -> 17 https://taxhub.bretagne-vivante.org/api/taxref/version -> 14

CMD

Backup de la bdd

pg_dump -Fc geonature2db > /mnt/sdb1/backups/backup-geonature.backup Save de la VM via esxi

update

cd ~/taxhub source venv/bin/activate flask db autoupgrade

-> continue demain

pierre56 commented 3 weeks ago

Correction

cd ~/taxhub source venv/bin/activate

apply-changes Procédure de migration de taxref vers la... import-taxref-v17 Procédure de migration de taxref vers la... test-changes-detection Analyse des répercussions de changement de taxref

flask taxref migrate-to-v17 import-taxref-v17 --keep-cdnom

flask taxref migrate-to-v17 test-changes-detection --keep-cdnom # Si migration vers Taxref v17

No such option: --keep-cdnom


cd source geonature/backend/venv/bin/activate

geonature taxref migrate-to-v17 [OPTIONS] COMMAND [ARGS]...

geonature taxref import-taxref-v17 geonature taxref import-v17 geonature taxref import-bdc-v17 geonature taxref migrate-to-v17 test-changes-detection --keep-cdnom geonature taxref migrate-to-v17 --keep-cdnom geonature taxref migrate-to-v17 --keep-cdnom import-taxref-v17
geonature taxref migrate-to-v17 import-taxref-v17 --keep-cdnom

geonature taxref migrate-to-v17 apply-changes --keep-cdnom

Update après correction

532885= espèce endémique de Porto-Rico ! découverte à Nantes ... dans la serre du Jardin des Plantes !!! donc --keep-cdnom

Impossible de faire la fin de la migration car impossible de faire vacuum database, car trop volumineux.

TODO

SHOW temp_tablespaces; ssd_temp_space, hdd_temp_space

ALTER TABLE gn_synthese.synthese SET TABLESPACE hdd_temp_space; VACUUM FULL VERBOSE your_table; -> pour voir si ça passe bien ALTER TABLE gn_synthese.synthese SET TABLESPACE ssd_temp_space;

cd source geonature/backend/venv/bin/activate geonature taxref migrate-to-v17 apply-changes --keep-cdnom

pierre56 commented 6 days ago

VACUUM FULL VERBOSE gn_synthese.synthese ; VACUUM FULL VERBOSE gn_synthese.cor_area_synthese; ALTER TABLE gn_synthese.synthese SET TABLESPACE ssd_temp_space; --> bascule de nouveau sur ssd pour la rapidité de requete

ALTER TABLE src_serena.temp_serena_geo SET TABLESPACE hdd_temp_space; VACUUM FULL VERBOSE src_serena.temp_serena_geo;

-- ALTER TABLE src_serena.temp_serena_geo SET TABLESPACE ssd_temp_space; ALTER TABLE src_serena.temp_serena_geo a fait gagner 30GO, SSD a 50go de libre 👍

geonature taxref migrate-to-v17 import-taxref-v17 -> to import geonature taxref migrate-to-v17 apply-changes --keep-cdnom -> to update

Déconnexion car vaccum long

nohup & -> ne marche pas

DOC Screen

https://serverfault.com/questions/98535/cant-get-detached-screen-to-resume

ps -ef | grep screen | grep pty ps -ef | grep bash | grep $PTY kill -KILL $PID

screen -XS quit screen -XS 102904 quit screen -XS 121212 quit Remove dead screens with 'screen -wipe'.

screen -a screen -S update_taxref screen -ls 102904.pts-0.vm-geonature 121212.update_taxref

screen -r 102904

screen -r 102904.pts-0.vm-geonature screen -r update_taxref screen -dr update_taxref

screen -x update_taxref -> fait déconner --> There is no screen to be resumed matching update_taxref.