Files
podman/update-database.sh
2024-11-20 12:01:52 +01:00

17 lines
694 B
Bash
Executable File

#!/bin/bash
echo "Dumping DB...."
ssh mstiller@maketank.net mysqldump -C --result-file=/tmp/mstillersql1.sql mstillersql1
echo "Copying here"
scp -C mstiller@maketank.net:/tmp/mstillersql1.sql /tmp/
echo 'Dropping local'
mariadb --skip-ssl -u root -h localhost --password=rootpW --port=3306 \
-e 'drop database mstillersql1; create database mstillersql1'
echo 'Importing new...'
mariadb --skip-ssl -u root -h localhost --password=rootpW --port=3306 \
mstillersql1 </tmp/mstillersql1.sql
mariadb --skip-ssl -u root -h localhost --password=rootpW --port=3306 mstillersql1 < changeurl.sql
echo 'Cleanup'
rm /tmp/mstillersql1.sql
ssh mstiller@maketank.net rm /tmp/mstillersql1.sql