Skip to content

Commit

Permalink
update vars
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Dec 29, 2022
1 parent b0b31f1 commit 27cfe72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions migration/bps/get-bps-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ while getopts "o:" arg; do
done

if [[
-z $WOUDC_ARCHIVE_HOSTNAME
|| -z $WOUDC_ARCHIVE_HOSTPORT
-z $WOUDC_ARCHIVE_HOST
|| -z $WOUDC_ARCHIVE_PORT
|| -z $WOUDC_ARCHIVE_DBNAME
|| -z $WOUDC_ARCHIVE_USERNAME
|| -z $WOUDC_ARCHIVE_PASSWORD
|| -z $WOUDC_DATAMART_HOSTNAME
|| -z $WOUDC_DATAMART_HOSTPORT
|| -z $WOUDC_DATAMART_HOST
|| -z $WOUDC_DATAMART_PORT
|| -z $WOUDC_DATAMART_DBNAME
|| -z $WOUDC_DATAMART_USERNAME
|| -z $WOUDC_DATAMART_PASSWORD
Expand Down Expand Up @@ -90,28 +90,28 @@ echo "Extracting metadata from woudc-archive"
export PGPASSWORD=$WOUDC_ARCHIVE_PASSWORD

echo " Projects..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($PROJECTS_QUERY) TO $OUTPUT_DIR/projects.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($PROJECTS_QUERY) TO $OUTPUT_DIR/projects.csv WITH CSV HEADER;"

echo " Datasets..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($DATASETS_QUERY) TO $OUTPUT_DIR/datasets.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($DATASETS_QUERY) TO $OUTPUT_DIR/datasets.csv WITH CSV HEADER;"

echo " Contributors..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($CONTRIBUTORS_QUERY) TO $OUTPUT_DIR/contributors.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($CONTRIBUTORS_QUERY) TO $OUTPUT_DIR/contributors.csv WITH CSV HEADER;"

echo " Stations..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($STATIONS_QUERY) TO $OUTPUT_DIR/stations.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($STATIONS_QUERY) TO $OUTPUT_DIR/stations.csv WITH CSV HEADER;"

echo " Station Names..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($STATION_NAMES_QUERY) TO $OUTPUT_DIR/station-names.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($STATION_NAMES_QUERY) TO $OUTPUT_DIR/station-names.csv WITH CSV HEADER;"

echo " Instruments..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($INSTRUMENTS_QUERY) TO $OUTPUT_DIR/instruments.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($INSTRUMENTS_QUERY) TO $OUTPUT_DIR/instruments.csv WITH CSV HEADER;"

echo " Deployments..."
psql -h $WOUDC_ARCHIVE_HOSTNAME -p $WOUDC_ARCHIVE_HOSTPORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($DEPLOYMENTS_QUERY) TO $OUTPUT_DIR/deployments.csv WITH CSV HEADER;"
psql -h $WOUDC_ARCHIVE_HOST -p $WOUDC_ARCHIVE_PORT -d $WOUDC_ARCHIVE_DBNAME -U $WOUDC_ARCHIVE_USERNAME -c "\\COPY ($DEPLOYMENTS_QUERY) TO $OUTPUT_DIR/deployments.csv WITH CSV HEADER;"

echo "Extracting metadata from woudc-web-db"
export PGPASSWORD=$WOUDC_DATAMART_PASSWORD

echo " Notifications..."
psql -h $WOUDC_DATAMART_HOSTNAME -p $WOUDC_DATAMART_HOSTPORT -d $WOUDC_DATAMART_DBNAME -U $WOUDC_DATAMART_USERNAME -c "\\COPY ($NOTIFICATIONS_QUERY) TO $OUTPUT_DIR/notifications.csv WITH CSV HEADER;"
psql -h $WOUDC_DATAMART_HOST -p $WOUDC_DATAMART_PORT -d $WOUDC_DATAMART_DBNAME -U $WOUDC_DATAMART_USERNAME -c "\\COPY ($NOTIFICATIONS_QUERY) TO $OUTPUT_DIR/notifications.csv WITH CSV HEADER;"
8 changes: 4 additions & 4 deletions migration/bps/migration.env.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# woudc-archive connection information
export WOUDC_ARCHIVE_HOSTNAME=woudc-archive-host
export WOUDC_ARCHIVE_HOSTPORT=woudc-archive-port
export WOUDC_ARCHIVE_HOST=woudc-archive-host
export WOUDC_ARCHIVE_PORT=woudc-archive-port
export WOUDC_ARCHIVE_DBNAME=woudc-archive
export WOUDC_ARCHIVE_USERNAME=woudcadmin
export WOUDC_ARCHIVE_PASSWORD=password1

# woudc-web-db connection information
export WOUDC_DATAMART_HOSTNAME=woudc-datamart-host
export WOUDC_DATAMART_HOSTPORT=woudc-datamart-host
export WOUDC_DATAMART_HOST=woudc-datamart-host
export WOUDC_DATAMART_PORT=woudc-datamart-host
export WOUDC_DATAMART_DBNAME=woudc-web-db
export WOUDC_DATAMART_USERNAME=woudcadmin
export WOUDC_DATAMART_PASSWORD=password2

0 comments on commit 27cfe72

Please sign in to comment.