Mercury Data Migration: Typhon → Hecate
· 3 min read
Executive Summary
Migrating all Mercury trading data from typhon (Hetzner/German digital vermaht jurisdiction) to hecate (secure jurisdiction) to preserve valuable trading information while eliminating jurisdiction risk.
Current State Assessment
Source: Typhon (95.216.19.225) - Hetzner (digital vermaht)
- PostgreSQL Databases (24GB total):
- mercury-a: 7.0 GB
- mercury-b: 7.0 GB
- mercury-h: 7.0 GB
- mercury-r: 3.0 GB
- Redis Data: 814 MB (TA cache + job queues)
- Status: All Mercury variants A,B,H,R running
Destination: Hecate (hecate-eth-almabay)
- Current State: Clean, no Mercury containers
- Capacity: Available for full Mercury deployment
Migration Strategy
Phase 1: Data Backup & Preparation (30 min)
- Stop Mercury services on typhon (graceful shutdown)
- Create PostgreSQL dumps for all variants
- Export Redis data (both RDB and AOF if available)
- Verify backup integrity
Phase 2: Environment Setup on Hecate (20 min)
- Deploy Mercury infrastructure using Tilt + docker-compose variants
- Initialize empty databases via docker-compose
- Configure networking and ports
Phase 3: Data Restoration (45 min)
- Transfer backup files typhon → hecate
- Restore PostgreSQL databases for all variants
- Restore Redis data
- Verify data integrity
Phase 4: Service Startup & Validation (15 min)
- Start Mercury services on hecate using Tilt (no Docker for bot/worker)
- Validate endpoints and health checks
- Verify trading data accessibility
- DNS/traffic cutover if needed
Technical Commands
Backup Commands (Typhon)
# PostgreSQL dumps
for variant in a b h r; do
docker exec ton-arcana-postgres-$variant-1 pg_dump -U postgres mercury-$variant > mercury-$variant-backup.sql
done
# Redis backup
docker exec ton-arcana-redis-1 redis-cli SAVE
docker cp ton-arcana-redis-1:/data/dump.rdb mercury-redis-backup.rdb
Transfer Commands
# Secure transfer to hecate
for variant in a b h r; do
scp mercury-$variant-backup.sql dev@hecate-eth-almabay:/tmp/
done
scp mercury-redis-backup.rdb dev@hecate-eth-almabay:/tmp/
Restoration Commands (Hecate)
# Restore PostgreSQL
for variant in a b h r; do
docker exec mercury-postgres-$variant-1 psql -U postgres -d mercury-$variant < /tmp/mercury-$variant-backup.sql
done
# Restore Redis
docker cp /tmp/mercury-redis-backup.rdb mercury-redis-1:/data/dump.rdb
docker restart mercury-redis-1
Risk Mitigation
- Data Verification: Checksums for all backup files
- Rollback Plan: Keep typhon running until hecate validated
- Downtime Window: Coordinate with trading schedules
- Monitoring: Health checks throughout migration
Success Criteria
- All 4 Mercury databases restored (24GB total)
- Redis cache data preserved (814MB)
- All Mercury endpoints responding on hecate
- Trading data queries successful
- Historical TA data accessible
Timeline
Total Estimated Time: 2 hours Recommended Window: Low trading activity period
Additional Requirements
Mercury-TA (Zephyr) Deployment
- No data migration required (API-only service)
- Deploy on hecate using Docker (part of docker-compose variants)
- Requires Bybit API whitelist → New Amnezia VPN server (ordering in progress)
VNC Access for Amnezia Configuration
- Current Status: GNOME desktop IS running on hecate (not broken!)
- Goal: Reliable VNC access from redmax → hecate for Amnezia UI setup
- Fallback: Alternative remote desktop solutions if VNC fails
VNC Recovery Plan
Safe VNC Setup Strategy
- Check existing GNOME session (already confirmed running)
- Install lightweight VNC alternative (x11vnc vs tigervnc)
- Minimal desktop session for VNC to avoid conflicts
- Fallback options: NoMachine, TeamViewer, or Chrome Remote Desktop
VNC Commands (Conservative Approach)
# Option 1: x11vnc (shares existing session)
sudo apt install x11vnc
x11vnc -display :0 -passwd yourpassword -forever -bg
# Option 2: Fresh tigervnc with XFCE fallback
sudo apt install tigervnc-standalone-server xfce4-session
vncserver :2 -geometry 1920x1080 -depth 24
Next Steps
- Phase 1: Execute Mercury data backup from typhon
- Phase 2: Setup Mercury infrastructure on hecate using Tilt
- Phase 3: Restore Mercury data and validate
- Phase 4: Setup VNC for Amnezia configuration
- Phase 5: Deploy Mercury-TA with VPN whitelist (Docker only)
- Phase 6: Decommission typhon services
Deployment Architecture
Hecate Deployment Strategy
- Mercury Bot/Worker: Deployed via Tilt (no Docker containers)
- Mercury-TA: Deployed via Docker (docker-compose variants)
- Infrastructure: PostgreSQL, Redis, Telegram Bot API via Docker
- Development: Tiltfile in repo root for easy hecate deployment
