Chemistry commons Notes: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Database Management == Source chemistry commons source /nfs/soft/anaconda3/bin/activate ~khtang/.conda/envs/chemcommons === Import data from Spreadsheet === ** This will be deprecated once we switched to use postgres bash /nfs/home/khtang/work/gitlab/ChemistryCommons-2-0/CC_load_scripts/load_common.bash import mem2 [Reactions_Reference_Spreadsheet.xlsx] === Export Chemistry Commons DB === Run this script to create a snapshot of the database and JSON files for Enum...") |
m (asdf) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
bash /nfs/home/khtang/work/gitlab/ChemistryCommons-2-0/CC_load_scripts/load_common.bash import mem2 [Reactions_Reference_Spreadsheet.xlsx] | bash /nfs/home/khtang/work/gitlab/ChemistryCommons-2-0/CC_load_scripts/load_common.bash import mem2 [Reactions_Reference_Spreadsheet.xlsx] | ||
=== Export Chemistry Commons DB === | === Export Chemistry Commons DB === | ||
ssh into epyc (or any machine with postgres) | |||
become mtsukanov (for write permission) | |||
cd /nfs/exj/Fe/scripts/common_db/ | |||
bash export_cc.bash | |||
(takes a couple of minutes) | |||
You are done! | |||
=== Restore data from backup === | === Restore data from backup === | ||
psql -U commoner -d commons -p 5434 < [db_snapshot_file] | psql -U commoner -d commons -p 5434 < [db_snapshot_file] | ||
Line 26: | Line 32: | ||
ssh epyc2 | ssh epyc2 | ||
sudo docker start chemcommons | sudo docker start chemcommons | ||
[[Category:Commons]] | |||
[[Category:Developer]] | |||
[[Category:Internal]] | |||
[[Category:Curator]] |
Latest revision as of 18:01, 2 May 2024
Database Management
Source chemistry commons
source /nfs/soft/anaconda3/bin/activate ~khtang/.conda/envs/chemcommons
Import data from Spreadsheet
- This will be deprecated once we switched to use postgres
bash /nfs/home/khtang/work/gitlab/ChemistryCommons-2-0/CC_load_scripts/load_common.bash import mem2 [Reactions_Reference_Spreadsheet.xlsx]
Export Chemistry Commons DB
ssh into epyc (or any machine with postgres) become mtsukanov (for write permission) cd /nfs/exj/Fe/scripts/common_db/ bash export_cc.bash
(takes a couple of minutes)
You are done!
Restore data from backup
psql -U commoner -d commons -p 5434 < [db_snapshot_file]
How to simulate disaster
Stop chemistry commons docker container
ssh epyc2 sudo docker stop chemcommons
Delete database and create
psql -h mem2 -U commoner -d excipients -p 5434 //psql console login => drop database commons; => create database commons;
Restore db
psql -U commoner -d commons -p 5434 < [db_snapshot_file]
Start CC docker container
ssh epyc2 sudo docker start chemcommons