diff options
| author | UMTS at Teleco <crt@teleco.ch> | 2025-12-13 02:59:39 +0100 |
|---|---|---|
| committer | UMTS at Teleco <crt@teleco.ch> | 2025-12-13 02:59:39 +0100 |
| commit | b51d33cb373e591d16892bde492616655ac9ec51 (patch) | |
| tree | 465d110a023857309806da5fc821de52573e2593 /backend/database/dev/export-full-dump.sh | |
committing to insanit
Diffstat (limited to 'backend/database/dev/export-full-dump.sh')
| -rwxr-xr-x | backend/database/dev/export-full-dump.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/backend/database/dev/export-full-dump.sh b/backend/database/dev/export-full-dump.sh new file mode 100755 index 0000000..782e4be --- /dev/null +++ b/backend/database/dev/export-full-dump.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# Export full database dump (schema + data + triggers) from current dev database +# This creates a single file that can be imported directly + +set -euo pipefail + +# Add mysql-client to PATH (keg-only on macOS) +export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH" + +DB_HOST="127.0.0.1" +DB_PORT="3306" +DB_USER="beepzone_user" +DB_PASS="BeepZONE77" +DB_NAME="beepzone" + +echo "Exporting full database dump (schema + data + triggers)..." +mysqldump \ + --host="$DB_HOST" \ + --port="$DB_PORT" \ + --user="$DB_USER" \ + --password="$DB_PASS" \ + --single-transaction \ + --routines \ + --triggers \ + --events \ + --skip-comments \ + --skip-dump-date \ + --skip-tz-utc \ + "$DB_NAME" > beepzone-full-dump.sql + +echo "Exported to: beepzone-full-dump.sql" +echo "" +echo "This file contains:" +echo " - Complete schema (CREATE TABLE statements)" +echo " - All data (INSERT statements)" +echo " - Triggers and routines" +echo " - Ready for single-file import" |
