open-webui-postgres-migration


Nameopen-webui-postgres-migration JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryA robust, interactive tool for migrating Open WebUI databases from SQLite to PostgreSQL
upload_time2025-07-12 17:57:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8.1
licenseMIT License Copyright (c) 2025 Taylor Wilsdon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords database migration open-webui postgresql sqlite
VCS
bugtrack_url
requirements markdown-it-py mdurl psycopg Pygments rich typing_extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Open WebUI PostgreSQL Migration Tool 🚀

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

## Preview
<img width="600" alt="Screenshot 2025-02-20 at 5 25 31 PM" src="https://github.com/user-attachments/assets/d3e9cb13-3aff-455a-9860-8b1d530f5b9d" />

## Migration Demo
https://github.com/user-attachments/assets/5ea8ed51-cc2d-49f0-9f1a-36e2f4e04f30

## ✨ Features

- 🖥️ 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

## 🚀 Quick Start

### Easy Installation with uvx (Recommended)

Run directly without installation:
```bash
uvx open-webui-postgres-migration
```

### Manual Installation

1. **Clone the repository:**
   ```bash
   git clone https://github.com/taylorwilsdon/open-webui-postgres-migration.git
   cd open-webui-postgres-migration
   ```

2. **Set up environment:**
   ```bash
   python -m venv venv
   source venv/bin/activate  # Windows: venv\Scripts\activate
   pip install -r requirements.txt
   ```

3. **Run the migration:**
   ```bash
   python migrate.py
   ```

## 📝 Best Practices

1. **Before Migration:**
   - Backup your SQLite database
   - **CRITICAL: Set up PostgreSQL database and tables FIRST**
       - Set the `DATABASE_URL` environment variable: `DATABASE_URL="postgresql://user:password@host:port/dbname"`
       - `export DATABASE_URL="postgresql://user:password@host:port/dbname"` for macOS / Linux
       - `set DATABASE_URL="postgresql://user:password@host:port/dbname"` for windows
       - Start Open WebUI with the PostgreSQL `DATABASE_URL` configured to create the database tables
       - Stop Open WebUI after confirming tables are created
       - **The migration script will verify this step was completed before proceeding**
   - Verify PostgreSQL server access from host running script
   - Check available disk space

2. **During Migration:**
   - Don't interrupt the process
   - Monitor system resources
   - Keep network connection stable

3. **After Migration:**
   - Verify data integrity
   - Test application functionality
   - Keep SQLite backup until verified


## 🔧 Configuration Options

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

## ⚙️ System Requirements

- Python 3.8+
- PostgreSQL server (running and accessible)
- Sufficient disk space for both databases
- Network access to PostgreSQL server

## 🛡️ Safety Features

- ✅ Pre-migration database integrity verification
- ✅ Transaction-based processing
- ✅ Automatic error recovery
- ✅ Failed row tracking and reporting
- ✅ Progress preservation on interruption

## 🚨 Troubleshooting

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 |


## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 💬 Support

If you encounter issues:
1. Check the troubleshooting section above
2. Search existing GitHub issues
3. Create a new issue with:
   - Error messages
   - Database versions
   - System information

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "open-webui-postgres-migration",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8.1",
    "maintainer_email": null,
    "keywords": "database, migration, open-webui, postgresql, sqlite",
    "author": null,
    "author_email": "Taylor Wilsdon <taylor@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/85/ec/021cc4074f8e62a18e06fb7d1910cee0f00d160b55e20eb970e0a5c07f9a/open_webui_postgres_migration-1.0.4.tar.gz",
    "platform": null,
    "description": "# Open WebUI PostgreSQL Migration Tool \ud83d\ude80\n\nA robust, interactive tool for migrating Open WebUI databases from SQLite to PostgreSQL. Designed for reliability and ease of use.\n\n## Preview\n<img width=\"600\" alt=\"Screenshot 2025-02-20 at 5 25 31\u202fPM\" src=\"https://github.com/user-attachments/assets/d3e9cb13-3aff-455a-9860-8b1d530f5b9d\" />\n\n## Migration Demo\nhttps://github.com/user-attachments/assets/5ea8ed51-cc2d-49f0-9f1a-36e2f4e04f30\n\n## \u2728 Features\n\n- \ud83d\udda5\ufe0f Interactive command-line interface with clear prompts\n- \ud83d\udd0d Comprehensive database integrity checking\n- \ud83d\udce6 Configurable batch processing for optimal performance\n- \u26a1 Real-time progress visualization\n- \ud83d\udee1\ufe0f Robust error handling and recovery\n- \ud83d\udd04 Unicode and special character support\n- \ud83c\udfaf Automatic table structure conversion\n\n## \ud83d\ude80 Quick Start\n\n### Easy Installation with uvx (Recommended)\n\nRun directly without installation:\n```bash\nuvx open-webui-postgres-migration\n```\n\n### Manual Installation\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/taylorwilsdon/open-webui-postgres-migration.git\n   cd open-webui-postgres-migration\n   ```\n\n2. **Set up environment:**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # Windows: venv\\Scripts\\activate\n   pip install -r requirements.txt\n   ```\n\n3. **Run the migration:**\n   ```bash\n   python migrate.py\n   ```\n\n## \ud83d\udcdd Best Practices\n\n1. **Before Migration:**\n   - Backup your SQLite database\n   - **CRITICAL: Set up PostgreSQL database and tables FIRST**\n       - Set the `DATABASE_URL` environment variable: `DATABASE_URL=\"postgresql://user:password@host:port/dbname\"`\n       - `export DATABASE_URL=\"postgresql://user:password@host:port/dbname\"` for macOS / Linux\n       - `set DATABASE_URL=\"postgresql://user:password@host:port/dbname\"` for windows\n       - Start Open WebUI with the PostgreSQL `DATABASE_URL` configured to create the database tables\n       - Stop Open WebUI after confirming tables are created\n       - **The migration script will verify this step was completed before proceeding**\n   - Verify PostgreSQL server access from host running script\n   - Check available disk space\n\n2. **During Migration:**\n   - Don't interrupt the process\n   - Monitor system resources\n   - Keep network connection stable\n\n3. **After Migration:**\n   - Verify data integrity\n   - Test application functionality\n   - Keep SQLite backup until verified\n\n\n## \ud83d\udd27 Configuration Options\n\nDuring the migration, you'll be prompted to configure:\n\n- **SQLite Database**\n  - Path to your existing SQLite database\n  - Automatic validation and integrity checking\n\n- **PostgreSQL Connection**\n  - Host and port\n  - Database name\n  - Username and password\n  - Connection testing before proceeding\n\n- **Performance Settings**\n  - Batch size (100-5000 recommended)\n  - Automatic memory usage warnings\n\n## \u2699\ufe0f System Requirements\n\n- Python 3.8+\n- PostgreSQL server (running and accessible)\n- Sufficient disk space for both databases\n- Network access to PostgreSQL server\n\n## \ud83d\udee1\ufe0f Safety Features\n\n- \u2705 Pre-migration database integrity verification\n- \u2705 Transaction-based processing\n- \u2705 Automatic error recovery\n- \u2705 Failed row tracking and reporting\n- \u2705 Progress preservation on interruption\n\n## \ud83d\udea8 Troubleshooting\n\nCommon issues and solutions:\n\n| Issue | Solution |\n|-------|----------|\n| Connection Failed | Check PostgreSQL credentials and firewall settings |\n| Permission Denied | Verify PostgreSQL user privileges |\n| Memory Errors | Reduce batch size in configuration |\n| Encoding Issues | Ensure proper database character encoding |\n\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\udcac Support\n\nIf you encounter issues:\n1. Check the troubleshooting section above\n2. Search existing GitHub issues\n3. Create a new issue with:\n   - Error messages\n   - Database versions\n   - System information\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Taylor Wilsdon\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "A robust, interactive tool for migrating Open WebUI databases from SQLite to PostgreSQL",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/taylorwilsdon/open-webui-postgres-migration",
        "Issues": "https://github.com/taylorwilsdon/open-webui-postgres-migration/issues",
        "Repository": "https://github.com/taylorwilsdon/open-webui-postgres-migration"
    },
    "split_keywords": [
        "database",
        " migration",
        " open-webui",
        " postgresql",
        " sqlite"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "df85fe939b13a1f6b560c3ce9411bffd834c169cac74dc75f87e4800f38914c4",
                "md5": "e3fb02d1fac5a486f7529c875d954ef6",
                "sha256": "e3feb886d32b20e877a1c76e9b46e1e1eae789939ebb92db2259ca92fd457d87"
            },
            "downloads": -1,
            "filename": "open_webui_postgres_migration-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e3fb02d1fac5a486f7529c875d954ef6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1",
            "size": 26388,
            "upload_time": "2025-07-12T17:57:50",
            "upload_time_iso_8601": "2025-07-12T17:57:50.904740Z",
            "url": "https://files.pythonhosted.org/packages/df/85/fe939b13a1f6b560c3ce9411bffd834c169cac74dc75f87e4800f38914c4/open_webui_postgres_migration-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "85ec021cc4074f8e62a18e06fb7d1910cee0f00d160b55e20eb970e0a5c07f9a",
                "md5": "ec0522e2c1b471fe93b126e2db8138e8",
                "sha256": "3faf75afeb28595578eb39a0d4b73589b63defc1e0fed7bb172ca78c28389ecd"
            },
            "downloads": -1,
            "filename": "open_webui_postgres_migration-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ec0522e2c1b471fe93b126e2db8138e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1",
            "size": 14380,
            "upload_time": "2025-07-12T17:57:51",
            "upload_time_iso_8601": "2025-07-12T17:57:51.932066Z",
            "url": "https://files.pythonhosted.org/packages/85/ec/021cc4074f8e62a18e06fb7d1910cee0f00d160b55e20eb970e0a5c07f9a/open_webui_postgres_migration-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 17:57:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "taylorwilsdon",
    "github_project": "open-webui-postgres-migration",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "markdown-it-py",
            "specs": [
                [
                    "==",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "mdurl",
            "specs": [
                [
                    "==",
                    "0.1.2"
                ]
            ]
        },
        {
            "name": "psycopg",
            "specs": [
                [
                    "==",
                    "3.2.3"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.19.1"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    "==",
                    "13.9.4"
                ]
            ]
        },
        {
            "name": "typing_extensions",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        }
    ],
    "lcname": "open-webui-postgres-migration"
}
        
Elapsed time: 0.49285s