forked from MythicalLTD/MythicalDash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExportDatabase.bash
23 lines (21 loc) · 1.22 KB
/
ExportDatabase.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
#export_db() {
# if [[ -f mythicaldash.sql ]]; then
# rm mythicaldashtmp.sql
# fi
# DB_NAME="mythicaldash"
# TEMP_DB_NAME="mythicaldash_temp"
# /usr/bin/mariadb -u root -e "DROP DATABASE IF EXISTS $TEMP_DB_NAME;"
# /usr/bin/mariadb -u root -e "CREATE DATABASE $TEMP_DB_NAME;"
# /usr/bin/mariadb-dump -u root --no-data "$DB_NAME" | /usr/bin/mariadb -u root "$TEMP_DB_NAME"
# /usr/bin/mariadb-dump -u root --no-data "$DB_NAME" --tables mythicaldash_apikeys mythicaldash_login_logs mythicaldash_logs mythicaldash_resetpasswords mythicaldash_settings mythicaldash_redeem mythicaldash_tickets mythicaldash_tickets_messages mythicaldash_users | /usr/bin/mariadb -u root "$TEMP_DB_NAME"
# TABLES="$(/usr/bin/mariadb -u root -N -B -e "SHOW TABLES IN $TEMP_DB_NAME")"
# for TABLE in $TABLES; do
# /usr/bin/mariadb -u root -e "TRUNCATE TABLE $TEMP_DB_NAME.$TABLE;"
# done
# /usr/bin/mariadb-dump -u root "$TEMP_DB_NAME" | sed '/^--/d; /^\/\*![0-9]\{5\}.*\*\//d; /^SET/d' > mythicaldashtmp.sql
# /usr/bin/mariadb -u root -e "DROP DATABASE $TEMP_DB_NAME;"
#}
#cd public
#export_db
echo "DO NOT DELETE THIS FILE IF YOU DID NOT INSTALL mythicaldash via the WebInterface first" > FIRST_INSTALL