================================================================================
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


================================================================================
