diff --git a/install.sh b/install.sh index 267c08ad26..991f8a3a89 100755 --- a/install.sh +++ b/install.sh @@ -588,6 +588,7 @@ BIN_FILES="src/nebula/oned \ src/cli/onedatastore \ src/cli/onecluster \ src/onedb/onedb \ + src/onedb/onezonedb/onezonedb \ src/authm_mad/remotes/quota/onequota \ src/mad/utils/tty_expect \ share/scripts/one" diff --git a/src/onedb/onezonedb/onezonedb b/src/onedb/onezonedb/onezonedb new file mode 100755 index 0000000000..1e316e4f48 --- /dev/null +++ b/src/onedb/onezonedb/onezonedb @@ -0,0 +1,54 @@ +#!/bin/bash + +if [ "$1" != "sqlite" -a "$1" != "mysql" -a "$1" != "postgres" ]; then + echo "$0: The first command needs to be one of {sqlite, mysql}" + exit 1 +fi + +MIGRATE_CMDS=$(cat <" + echo " where is optional and defaults to localhost" + exit 1 + fi + + if [ -z $4 ]; then + MYSQL_SERVER="localhost" + else + MYSQL_SERVER=$4 + fi + + mysql -u $2 --password=$3 -h $MYSQL_SERVER ozones < <(echo $MIGRATE_CMDS) +fi + +if [ $? -ne 0 ]; then + echo "There was an error during migration" +else + echo "Migration successful" +fi +