From 8bf4190b0fef290be881cce59ae7ffedc0b5fc49 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sat, 2 May 2015 11:36:28 +0200 Subject: [PATCH] Using localhost Postgres instance. Populating test and dev, too. --- bin/get-data-from-old-live-server.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/get-data-from-old-live-server.sh b/bin/get-data-from-old-live-server.sh index cd48b3a..530fc5f 100755 --- a/bin/get-data-from-old-live-server.sh +++ b/bin/get-data-from-old-live-server.sh @@ -1,9 +1,9 @@ #!/bin/sh -ex -#IMAGE_DEST=../public -IMAGE_DEST=/local/screenshots -#DB_HOST=localhost -DB_HOST=torf +IMAGE_DEST=public/screenshots +#IMAGE_DEST=/local/screenshots +DB_HOST=localhost +#DB_HOST=torf echo Getting screenshot files rsync -v root@screenshots.debian.net:/home/debshots/debshots-screenshots.tar /tmp @@ -14,13 +14,19 @@ rsync -v root@screenshots.debian.net:/home/debshots/debshots.sql /tmp echo Dropping existing database set +e psql -h $DB_HOST postgres debshots -c 'drop database debshots' +psql -h $DB_HOST postgres debshots -c 'drop database debshots_dev' +psql -h $DB_HOST postgres debshots -c 'drop database debshots_test' set -e echo Creating new database psql -h $DB_HOST postgres debshots -c 'create database debshots owner debshots' +psql -h $DB_HOST postgres debshots -c 'create database debshots_dev owner debshots' +psql -h $DB_HOST postgres debshots -c 'create database debshots_test owner debshots' echo Restoring PostgreSQL dump psql -h $DB_HOST debshots debshots < /tmp/debshots.sql +psql -h $DB_HOST debshots_dev debshots < /tmp/debshots.sql +psql -h $DB_HOST debshots_test debshots < /tmp/debshots.sql echo Unpacking screenshots tarball #cd ../public