Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion shared-to-shared-migrate-k8s-mydumper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,23 @@ shw_norm "================================================"
shw_info "> Importing the dump into ${PROVIDER_HOST}"
shw_info "================================================"
kubectl -n "$NAMESPACE" exec "$POD" -- bash -c "time myloader -h '$PROVIDER_HOST' -u '$DB_USER' -p '$DB_PASSWORD' -B '$DB_NAME' --verbose 2 -d /tmp/mydumper --overwrite-tables"
kubectl -n "$NAMESPACE" exec "$POD" -- bash -c "rm -rf /tmp/mydumper && rm $MIGRATE_FILE && rm $CONF_FILE"
shw_norm "> Import is done"
shw_norm "================================================"

# Analyze imported database.
shw_info "> Analyzing imported database ${DB_NAME}"
shw_info "================================================"
kubectl -n "$NAMESPACE" exec "$POD" -- bash -c "time mysqlcheck -h '$PROVIDER_HOST' -u '$DB_USER' -p'$DB_PASSWORD' --analyze '$DB_NAME'"
shw_norm "> Analyze is done"
shw_norm "================================================"

# Clean up temporary files.
shw_info "> Cleaning up temporary migration files"
shw_info "================================================"
kubectl -n "$NAMESPACE" exec "$POD" -- bash -c "rm -rf /tmp/mydumper && rm $MIGRATE_FILE && rm $CONF_FILE"
shw_norm "> Cleanup is done"
shw_norm "================================================"

# Alter the network service(s).
shw_info "> Altering the Network Service $DB_NETWORK_SERVICE to point at $PROVIDER_HOST"
shw_info "================================================"
Expand Down