Files
mysql2postgres/START_HERE.md

212 lines
4.9 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🚀 MySQL to PostgreSQL Migration Tool
**Benvenuto!** Questo è il tuo punto di partenza per utilizzare il migration tool.
## 📋 Indice Rapido
### Per gli Impazienti (5 minuti)
→ Vai a [QUICKSTART.md](QUICKSTART.md)
### Per i Dettagli Completi
→ Vai a [README.md](README.md)
### Per un Esempio Pratico
→ Vai a [EXAMPLE_WORKFLOW.md](EXAMPLE_WORKFLOW.md)
### Per Capire Come è Fatto
→ Vai a [IMPLEMENTATION_SUMMARY.md](IMPLEMENTATION_SUMMARY.md)
---
## 🎯 Cosa Puoi Fare
### 1⃣ Migrare il Database
```bash
python main.py setup --create-schema # Setup schema
python main.py migrate full # Migrare tutti i dati
```
### 2⃣ Sincronizzare i Cambiamenti
```bash
python main.py migrate incremental # Migrare solo i nuovi record
```
### 3⃣ Testare le Performance
```bash
python main.py benchmark # Confronto MySQL vs PostgreSQL
```
### 4⃣ Verificare la Configurazione
```bash
python main.py info # Mostra settings
```
---
## 📚 Documentazione Disponibile
| File | Contenuto | Leggi Se... |
|------|----------|-----------|
| [README.md](README.md) | Guida completa (600+ linee) | Vuoi tutto |
| [QUICKSTART.md](QUICKSTART.md) | Setup in 5 minuti | Hai fretta |
| [EXAMPLE_WORKFLOW.md](EXAMPLE_WORKFLOW.md) | Scenario reale step-by-step | Vuoi un esempio |
| [IMPLEMENTATION_SUMMARY.md](IMPLEMENTATION_SUMMARY.md) | Dettagli tecnici | Sei developer |
---
## ⚡ Setup Rapido
### 1. Installazione
```bash
./install.sh
source venv/bin/activate
```
### 2. Configurazione
```bash
cp .env.example .env
# Edita .env con i tuoi dettagli
```
### 3. Crea PostgreSQL (opzionale)
```bash
bash scripts/incus_setup.sh pg-server password123
```
### 4. Esegui Migrazione
```bash
python main.py setup --create-schema
python main.py migrate full
```
---
## 🔍 Trovare Quello che Serve
### Ho Domande su...
**Come installare?**
→ [QUICKSTART.md - Setup](QUICKSTART.md#setup-in-5-minuti)
**Come migrare i dati?**
→ [EXAMPLE_WORKFLOW.md - Migrazione](EXAMPLE_WORKFLOW.md#8-migrazione-completa-60-min-per-dati-grandi)
**Come fare query su JSONB?**
→ [README.md - Query su JSONB](README.md#query-su-jsonb) oppure [QUICKSTART.md - Esempi Query](QUICKSTART.md#esempi-di-query-su-postgresql)
**Qual è la struttura JSONB?**
→ [README.md - Trasformazione Dati](README.md#trasformazione-dati)
**Come fare il benchmark?**
→ [README.md - Benchmark](README.md#benchmark)
**Come si fa la migrazione incrementale?**
→ [QUICKSTART.md - Migrazioni Periodiche](QUICKSTART.md#migrazioni-periodiche)
**Cosa fare se c'è un errore?**
→ [README.md - Troubleshooting](README.md#troubleshooting)
**Come funziona internamente?**
→ [IMPLEMENTATION_SUMMARY.md](IMPLEMENTATION_SUMMARY.md)
---
## 📦 Cosa Contiene il Tool
### Funzionalità
✅ Migrazione completa (full)
✅ Migrazione incrementale (delta)
✅ Trasformazione JSONB automatica
✅ Benchmark MySQL vs PostgreSQL
✅ Partizionamento nativo PostgreSQL
✅ GIN indexes per JSONB
✅ Progress tracking
✅ Logging con Rich
### Script Helper
`install.sh` - Setup rapido
`scripts/incus_setup.sh` - PostgreSQL container
`scripts/validate_migration.sql` - Validazione dati
`scripts/setup_cron.sh` - Scheduling automatico
### Comandi CLI
`setup` - Crea schema
`migrate full` - Migrazione completa
`migrate incremental` - Migrazione delta
`benchmark` - Performance test
`info` - Mostra config
---
## 🎓 Primi Passi
### Passo 1: Leggi il QUICKSTART
Apri [QUICKSTART.md](QUICKSTART.md) per un setup veloce.
### Passo 2: Configura .env
Copia `.env.example` a `.env` e inserisci le tue credenziali.
### Passo 3: Esegui Installazione
```bash
./install.sh
```
### Passo 4: Verifica Configurazione
```bash
python main.py info
```
### Passo 5: Setup Schema PostgreSQL
```bash
python main.py setup --create-schema
```
### Passo 6: Migra i Dati
```bash
python main.py migrate full
```
### Passo 7: Test Performance
```bash
python main.py benchmark
```
---
## 💡 Tips
- **Migrazione lenta?** Aumenta `BATCH_SIZE` in `.env`
- **Vuoi solo una tabella?** Usa `--table RAWDATACOR` con i comandi
- **Primo test?** Usa `--dry-run` per vedere cosa verrebbe fatto
- **Automatizzare?** Usa `scripts/setup_cron.sh` per scheduled sync
---
## 📞 Aiuto
Se hai domande:
1. Leggi il [README.md](README.md) completo
2. Consulta [EXAMPLE_WORKFLOW.md](EXAMPLE_WORKFLOW.md) per scenario reale
3. Guarda [IMPLEMENTATION_SUMMARY.md](IMPLEMENTATION_SUMMARY.md) per dettagli tecnici
4. Controlla la sezione Troubleshooting nel README
---
## ✅ Checklist Prima di Partire
- [ ] Ho Python 3.10+
- [ ] Ho MySQL e PostgreSQL disponibili
- [ ] Ho copiato .env.example a .env
- [ ] Ho configurato credenziali in .env
- [ ] Ho eseguito `./install.sh`
- [ ] Ho testato `python main.py info` con successo
Se tutti i checkmark sono spuntati, sei pronto!
---
**Buona migrazione! 🎉**
Domande? Consulta la documentazione qui sopra.