Chemistry commons Notes

From DISI
Jump to navigation Jump to search

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