#!/usr/bin/env bash # Save the local database to a file you can carry to the server. # deploy/export-db.sh [output-file] set -euo pipefail cd "$(dirname "$0")/.." out="${1:-musicshare-$(date +%Y%m%d-%H%M).dump}" docker compose exec -T postgres pg_dump -U musicshare -d musicshare --format=custom --no-owner > "$out" echo "Saved $(du -h "$out" | cut -f1) to $out" echo echo "IMPORTANT: connected services (Plex, Last.fm, Jellyfin...) are encrypted with TOKEN_ENCRYPTION_KEY." echo "Put the SAME key in deploy/production.env on the server, or those connections must be redone:" grep '^TOKEN_ENCRYPTION_KEY=' apps/api/.env 2>/dev/null | sed 's/=.*/=/' || true