Files
tianpu-ems/scripts/gitea-migration/01_export_mac_studio.sh
Du Wenbo 02c4698b59 feat: multi-customer architecture + Z-Park support + Gitea migration scripts
Multi-customer config system:
- CUSTOMER env var selects customer (tianpu/zpark)
- customers/tianpu/config.yaml — Tianpu branding, collectors, features
- customers/zpark/config.yaml — Z-Park branding, Sungrow collector
- GET /api/v1/branding endpoint for customer-specific branding
- main.py loads customer config for app title, CORS, logging
- Collector manager filters by customer's enabled collectors

Z-Park (中关村医疗器械园) support:
- Sungrow iSolarCloud API collector (sungrow_collector.py)
- Z-Park device definitions (10 inverters, 8 combiner boxes, 22+ buildings)
- Z-Park TOU pricing config (Beijing 2026 rates)
- Z-Park seed script (seed_zpark.py)

Gitea migration scripts (Mac Studio → labmac3):
- 5 migration scripts + README in scripts/gitea-migration/
- Creates 3-repo structure: ems-core, tp-ems, zpark-ems

Version: v1.0.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 16:23:33 +08:00

33 lines
1.0 KiB
Bash

#!/bin/bash
# Run this ON Mac Studio (SSH into 100.108.180.60 first)
# Usage: ssh duwenbo@100.108.180.60 'bash -s' < 01_export_mac_studio.sh
echo "=== Exporting Gitea from Mac Studio ==="
# Find Gitea container name
CONTAINER=$(docker ps --filter "ancestor=gitea/gitea" --format "{{.Names}}" | head -1)
if [ -z "$CONTAINER" ]; then
CONTAINER=$(docker ps --format "{{.Names}}" | grep -i gitea | head -1)
fi
echo "Gitea container: $CONTAINER"
# Create backup directory
mkdir -p ~/gitea-backup
cd ~/gitea-backup
# Method 1: Try gitea dump
echo "Attempting gitea dump..."
docker exec $CONTAINER gitea dump -c /data/gitea/conf/app.ini -f /tmp/gitea-dump.zip 2>/dev/null
docker cp $CONTAINER:/tmp/gitea-dump.zip ./gitea-dump.zip 2>/dev/null
# Method 2: Copy data volume directly
echo "Copying Gitea data volume..."
docker cp $CONTAINER:/data/gitea ./gitea-data
echo "=== Export complete ==="
echo "Files in ~/gitea-backup/:"
ls -la ~/gitea-backup/
echo ""
echo "Next step: Transfer to labmac3:"
echo " scp -r ~/gitea-backup duwenbo@192.168.1.77:/opt/"