berlinguyinca / binbase

Automatically exported from code.google.com/p/binbase
0 stars 0 forks source link

create simpler way to clone database #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
current approach

1. copy the schema without content

pg_dump -c -n rtx5 -s binbase | sed -e 's/rtx5/rtx5recal/g' | psql binbase

2. fill with default data

SET search_path = rtx5recal, pg_catalog;
insert into rtx5recal.standard select * from rtx5.standard;
insert into rtx5recal.bin select * from rtx5.bin where bin_id in (select bin_id 
from rtx5.standard);
insert into rtx5recal.samples select * from rtx5.samples where sample_id in 
(select sample_id from rtx5recal.bin);
insert into rtx5recal.spectra select * from rtx5.spectra where sample_id in 
(select sample_id from rtx5recal.bin);

3. add to central minix configuration

Original issue reported on code.google.com by berlinguyinca on 2 Aug 2013 at 9:41