mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-07 21:01:37 +00:00
Directory Structure [step 1]: moving files
working on #672 NOTE: This commit can't be compiled!!
This commit is contained in:
1
apps/db_exporter/.gitignore
vendored
Normal file
1
apps/db_exporter/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
config.sh
|
||||
12
apps/db_exporter/README.md
Normal file
12
apps/db_exporter/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
This script is used by devs to export the databases to base directories
|
||||
|
||||
You should use it on clean databases
|
||||
|
||||
## USAGE
|
||||
|
||||
NOTE: this script is only working under unix currently
|
||||
|
||||
1) You must create a config.sh file changing DB connection configurations
|
||||
of /conf/config.sh.dist
|
||||
|
||||
2) Run the db_export.sh script and wait
|
||||
45
apps/db_exporter/db_export.sh
Normal file
45
apps/db_exporter/db_export.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ROOTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"
|
||||
|
||||
source $ROOTPATH"/bin/bash_shared/includes.sh"
|
||||
|
||||
if [ -f "./config.sh" ]; then
|
||||
source "./config.sh" # should overwrite previous
|
||||
fi
|
||||
|
||||
echo "===== STARTING PROCESS ====="
|
||||
|
||||
|
||||
function export() {
|
||||
echo "Working on: "$1
|
||||
database=$1
|
||||
|
||||
var_base_path="DB_"$database"_PATHS"
|
||||
base_path=${!var_base_path}
|
||||
|
||||
base_conf="TPATH="$base_path";\
|
||||
CLEANFOLDER=1; \
|
||||
CHMODE=0; \
|
||||
TEXTDUMPS=0; \
|
||||
PARSEDUMP=1; \
|
||||
FULL=0; \
|
||||
DUMPOPTS='--skip-comments --skip-set-charset --routines --extended-insert --order-by-primary --single-transaction --quick'; \
|
||||
"
|
||||
|
||||
var_base_conf="DB_"$database"_CONF"
|
||||
base_conf=$base_conf${!var_base_conf}
|
||||
|
||||
var_base_name="DB_"$database"_NAME"
|
||||
base_name=${!var_base_name}
|
||||
|
||||
|
||||
bash $AC_PATH_MODULES"/drassil/mysql-tools/mysql-tools" dump "" $base_name "" "$base_conf"
|
||||
}
|
||||
|
||||
for db in ${DATABASES[@]}
|
||||
do
|
||||
export "$db"
|
||||
done
|
||||
|
||||
echo "===== DONE ====="
|
||||
Reference in New Issue
Block a user