#!/bin/bash

set -e

echo "dumpo il db"
mysqldump -h 82.88.60.167 -u kria -pkriaman eventserverdb --verbose > "dump-staging.sql"

echo "cancello il db"
mysql -u kria -pkriaman  -e "DROP DATABASE IF EXISTS eventserverdb; CREATE DATABASE eventserverdb"

echo "importo il db"
mysql -u kria -pkriaman eventserverdb < dump-staging.sql
