mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-19 21:28:33 +02:00
Docs: Quick start PostgreSQL migration
Ajout des outils de migration et documentation: - scripts/verify-postgres-connection.js: Test connexion PostgreSQL - scripts/run-migration.sh: Script automatique de migration - docker-compose.yml: Volume mount pour accès SQLite depuis container - MIGRATION-STEPS.md: Guide pas-à-pas complet de migration La migration peut maintenant être lancée avec: docker-compose build notes-app docker-compose up -d bash scripts/run-migration.sh
This commit is contained in:
4 files changed
+289
No files matched your search
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script de migration SQLite → PostgreSQL
|
||||
# À exécuter depuis le host où Docker tourne
|
||||
|
||||
echo "🔄 Migration SQLite → PostgreSQL"
|
||||
echo "================================"
|
||||
echo ""
|
||||
|
||||
# Vérifier que les containers tournent
|
||||
if ! docker ps | grep -q "noteflow-postgres"; then
|
||||
echo "❌ Container PostgreSQL non trouvé. Lancez: docker-compose up -d"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! docker ps | grep -q "notes-todo-app"; then
|
||||
echo "❌ Container notes-todo-app non trouvé. Lancez: docker-compose up -d"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Containers trouvés"
|
||||
echo ""
|
||||
|
||||
# Test de connexion PostgreSQL
|
||||
echo "🔍 Test de connexion PostgreSQL..."
|
||||
docker exec notes-todo-app node scripts/verify-postgres-connection.js
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo ""
|
||||
echo "❌ Impossible de se connecter à PostgreSQL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "📊 Lancement de la migration..."
|
||||
echo ""
|
||||
|
||||
# Exécuter la migration depuis le container notes-todo-app
|
||||
# Le fichier SQLite est monté dans /app/data-sqlite/notes.db
|
||||
docker exec -e SQLITE_PATH=/app/data-sqlite/notes.db notes-todo-app node scripts/migrate-sqlite-to-postgres.js
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "✅ Migration terminée avec succès!"
|
||||
echo ""
|
||||
echo "📋 Prochaines étapes:"
|
||||
echo " 1. Vérifier les articles RSS dans l'interface"
|
||||
echo " 2. Tester la récupération des flux RSS"
|
||||
echo " 3. Supprimer l'ancienne base SQLite (data/notes.db) si tout fonctionne"
|
||||
else
|
||||
echo ""
|
||||
echo "❌ Erreur lors de la migration"
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user