Adding script to download screenshots and SQL from old live server
This commit is contained in:
parent
50601b9dcb
commit
4d101edc10
1 changed files with 25 additions and 0 deletions
25
bin/get-data-from-old-live-server.sh
Executable file
25
bin/get-data-from-old-live-server.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
echo Getting screenshot files
|
||||
rsync -v root@screenshots.debian.net:/home/debshots/debshots-screenshots.tar /tmp/
|
||||
|
||||
echo Getting PostgreSQL dump
|
||||
rsync -v root@screenshots.debian.net:/home/debshots/debshots.sql /tmp
|
||||
|
||||
echo Dropping existing database
|
||||
set +e
|
||||
psql postgres debshots -c 'drop database debshots'
|
||||
set -e
|
||||
|
||||
echo Creating new database
|
||||
psql postgres debshots -c 'create database debshots owner debshots'
|
||||
|
||||
echo Restoring PostgreSQL dump
|
||||
psql debshots debshots < /tmp/debshots.sql
|
||||
|
||||
echo Unpacking screenshots tarball
|
||||
cd ../public
|
||||
tar xf /tmp/debshots-screenshots.tar
|
||||
mv public/live/screenshots/approved public/screenshots
|
||||
rm -r public/live
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue