Files
claudetools/docs/database/COPY_PASTE_MIGRATION_FIXED.txt
Mike Swanson 06f7617718 feat: Major directory reorganization and cleanup
Reorganized project structure for better maintainability and reduced
disk usage by 95.9% (11 GB -> 451 MB).

Directory Reorganization (85% reduction in root files):
- Created docs/ with subdirectories (deployment, testing, database, etc.)
- Created infrastructure/vpn-configs/ for VPN scripts
- Moved 90+ files from root to organized locations
- Archived obsolete documentation (context system, offline mode, zombie debugging)
- Moved all test files to tests/ directory
- Root directory: 119 files -> 18 files

Disk Cleanup (10.55 GB recovered):
- Deleted Rust build artifacts: 9.6 GB (target/ directories)
- Deleted Python virtual environments: 161 MB (venv/ directories)
- Deleted Python cache: 50 KB (__pycache__/)

New Structure:
- docs/ - All documentation organized by category
- docs/archives/ - Obsolete but preserved documentation
- infrastructure/ - VPN configs and SSH setup
- tests/ - All test files consolidated
- logs/ - Ready for future logs

Benefits:
- Cleaner root directory (18 vs 119 files)
- Logical organization of documentation
- 95.9% disk space reduction
- Faster navigation and discovery
- Better portability (build artifacts excluded)

Build artifacts can be regenerated:
- Rust: cargo build --release (5-15 min per project)
- Python: pip install -r requirements.txt (2-3 min)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:42:28 -07:00

126 lines
4.3 KiB
Plaintext

================================================================================
DATA MIGRATION - COPY/PASTE COMMANDS (CORRECTED)
================================================================================
Container name: MariaDB-Official (not mariadb)
Step 1: Open PuTTY and connect to Jupiter (172.16.3.20)
------------------------------------------------------------------------
Copy and paste this entire block:
docker exec MariaDB-Official mysqldump \
-u claudetools \
-pCT_e8fcd5a3952030a79ed6debae6c954ed \
--no-create-info \
--skip-add-drop-table \
--insert-ignore \
--complete-insert \
claudetools | \
ssh guru@172.16.3.30 "mysql -u claudetools -pCT_e8fcd5a3952030a79ed6debae6c954ed -D claudetools"
Press Enter and wait (should complete in 5-10 seconds)
Expected output: (nothing = success, or some INSERT statements scrolling by)
Step 2: Verify the migration succeeded
------------------------------------------------------------------------
Open another PuTTY window and connect to RMM (172.16.3.30)
Copy and paste this:
mysql -u claudetools -pCT_e8fcd5a3952030a79ed6debae6c954ed -D claudetools -e "SELECT TABLE_NAME, TABLE_ROWS FROM information_schema.TABLES WHERE TABLE_SCHEMA='claudetools' AND TABLE_ROWS > 0 ORDER BY TABLE_ROWS DESC;"
Expected output:
TABLE_NAME TABLE_ROWS
conversation_contexts 68
(possibly other tables with data)
Step 3: Test from Windows
------------------------------------------------------------------------
Open PowerShell or Command Prompt and run:
curl -s http://172.16.3.30:8001/api/conversation-contexts?limit=3
Expected: JSON output with 3 conversation contexts
================================================================================
TROUBLESHOOTING
================================================================================
If Step 1 asks for a password:
- Enter the password for guru@172.16.3.30 when prompted
If Step 1 says "Permission denied":
- RMM and Jupiter need SSH keys configured
- Alternative: Do it in 3 steps (export, copy, import) - see below
If Step 2 shows 0 rows:
- Something went wrong with import
- Check for error messages from Step 1
================================================================================
ALTERNATIVE: 3-STEP METHOD (if single command doesn't work)
================================================================================
On Jupiter (172.16.3.20):
------------------------------------------------------------------------
docker exec MariaDB-Official mysqldump \
-u claudetools \
-pCT_e8fcd5a3952030a79ed6debae6c954ed \
--no-create-info \
--skip-add-drop-table \
--insert-ignore \
--complete-insert \
claudetools > /tmp/data_export.sql
ls -lh /tmp/data_export.sql
Copy this file to RMM:
------------------------------------------------------------------------
scp /tmp/data_export.sql guru@172.16.3.30:/tmp/
On RMM (172.16.3.30):
------------------------------------------------------------------------
mysql -u claudetools -pCT_e8fcd5a3952030a79ed6debae6c954ed -D claudetools < /tmp/data_export.sql
Verify:
------------------------------------------------------------------------
mysql -u claudetools -pCT_e8fcd5a3952030a79ed6debae6c954ed -D claudetools -e "SELECT COUNT(*) as contexts FROM conversation_contexts;"
Should show: contexts = 68 (or more)
================================================================================
QUICK CHECK: Is there data on Jupiter to migrate?
================================================================================
On Jupiter (172.16.3.20):
------------------------------------------------------------------------
docker exec MariaDB-Official mysql -u claudetools -pCT_e8fcd5a3952030a79ed6debae6c954ed -D claudetools -e "SELECT COUNT(*) FROM conversation_contexts;"
Should show: 68 (from yesterday's import)
If it shows 0, then there's nothing to migrate!
================================================================================
CLEANUP (after successful migration)
================================================================================
On Jupiter (172.16.3.20):
------------------------------------------------------------------------
rm /tmp/data_export.sql
On RMM (172.16.3.30):
------------------------------------------------------------------------
rm /tmp/data_export.sql
================================================================================