aboutsummaryrefslogtreecommitdiff
path: root/backend/database/dev/export-full-dump.sh
blob: 782e4be5f7d4786bc4dbbab7cf1ab544f9a329ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"