A robust, interactive tool for migrating Open WebUI databases from SQLite to PostgreSQL. Designed for reliability and ease of use.

openwebui_postgres_migration.mov
- 🖥️ Interactive command-line interface with clear prompts
- 🔍 Comprehensive database integrity checking
- 📦 Configurable batch processing for optimal performance
- ⚡ Real-time progress visualization
- 🛡️ Robust error handling and recovery
- 🔄 Unicode and special character support
- 🎯 Automatic table structure conversion
-
Clone the repository:
git clone https://github.com/yourusername/open-webui-postgres-migration.git cd open-webui-postgres-migration
-
Set up environment:
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Run the migration:
python migrate.py
During the migration, you'll be prompted to configure:
-
SQLite Database
- Path to your existing SQLite database
- Automatic validation and integrity checking
-
PostgreSQL Connection
- Host and port
- Database name
- Username and password
- Connection testing before proceeding
-
Performance Settings
- Batch size (100-5000 recommended)
- Automatic memory usage warnings
- Python 3.8+
- PostgreSQL server (running and accessible)
- Sufficient disk space for both databases
- Network access to PostgreSQL server
- ✅ Pre-migration database integrity verification
- ✅ Transaction-based processing
- ✅ Automatic error recovery
- ✅ Failed row tracking and reporting
- ✅ Progress preservation on interruption
Common issues and solutions:
Issue | Solution |
---|---|
Connection Failed | Check PostgreSQL credentials and firewall settings |
Permission Denied | Verify PostgreSQL user privileges |
Memory Errors | Reduce batch size in configuration |
Encoding Issues | Ensure proper database character encoding |
-
Before Migration:
- Backup your SQLite database
- Verify PostgreSQL server access
- Check available disk space
-
During Migration:
- Don't interrupt the process
- Monitor system resources
- Keep network connection stable
-
After Migration:
- Verify data integrity
- Test application functionality
- Keep SQLite backup until verified
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter issues:
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with:
- Error messages
- Database versions
- System information