aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshare/hydractl/backup-restore-site5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site
index d02fb79..15c0d97 100755
--- a/share/hydractl/backup-restore-site
+++ b/share/hydractl/backup-restore-site
@@ -73,7 +73,12 @@ fi
# Restore database
if [ -f "$RESTOREDIR/var/backups/mysql/sqldump/$SITE.sql.gz" ]; then
+ hydra_set_tmpfile $SITE -d
+ cp $RESTOREDIR/var/backups/mysql/sqldump/$SITE.sql.gz $TMPWORK
+ ( cd $TMPWORK && gunzip $SITE.sql.gz )
hydra_truncate_database $SITE
+ mysql $SITE < $TMPWORK.sql
+ hydra_unset_tmpfile $TMPWORK
else
echo "Databases should be manually restored"
fi