{"id":29374664,"url":"https://github.com/yetanotherchris/openwebui-importer","last_synced_at":"2025-07-09T20:10:56.661Z","repository":{"id":300481715,"uuid":"1005789264","full_name":"yetanotherchris/openwebui-importer","owner":"yetanotherchris","description":"Import Grok, Claude, ChatGPT chats into Open-WebUI","archived":false,"fork":false,"pushed_at":"2025-06-22T00:07:10.000Z","size":1421,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T00:19:06.888Z","etag":null,"topics":["chatgpt","claude-ai","grok","openwebui","python","sql","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yetanotherchris.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-20T20:28:10.000Z","updated_at":"2025-06-22T00:07:13.000Z","dependencies_parsed_at":"2025-06-22T00:29:17.142Z","dependency_job_id":null,"html_url":"https://github.com/yetanotherchris/openwebui-importer","commit_stats":null,"previous_names":["yetanotherchris/openwebui-importer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yetanotherchris/openwebui-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanotherchris%2Fopenwebui-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanotherchris%2Fopenwebui-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanotherchris%2Fopenwebui-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanotherchris%2Fopenwebui-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yetanotherchris","download_url":"https://codeload.github.com/yetanotherchris/openwebui-importer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yetanotherchris%2Fopenwebui-importer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502621,"owners_count":23618658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","claude-ai","grok","openwebui","python","sql","sqlite3"],"created_at":"2025-07-09T20:10:55.612Z","updated_at":"2025-07-09T20:10:56.650Z","avatar_url":"https://github.com/yetanotherchris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openwebui-importer\n\n**Import Grok, Claude and ChatGPT chats into [open-webui](https://github.com/open-webui/open-webui).**\n\nThis importer tool has two Python scripts: one for converting the model JSON files to openweb-ui format JSON, the second for \ncreating a SQL script to import the JSON into the openweb-ui SQLite database.  \n\nThe imported chats are given the tags `imported-chatgpt`, `imported-claude` and `imported-grok`.\n\nAny private-use Unicode characters occasionally found in model exports are stripped from the message text during conversion.\n\n*There were problems exporting chats from Gemini, so it's not currently supported. DeepSeek and others could be added without much effort.*\n\n## Quick start\n\n```\npython .\\convert_chatgpt.py --userid=\"get-this-from-your-webui.db\" .\\chatgpt.json   \npython .\\create_sql.py ./output/chatgpt --tags=\"imported-chatgpt\" --output=chatgpt.sql\n```\n\n## Scripts\n\nInstall the required Python dependencies first:\n\n```bash\npip install -r requirements.txt\n```\n\n### convert_chatgpt.py\n\n```\nusage: convert_chatgpt.py [-h] --userid USERID [--output-dir OUTPUT_DIR] files [files ...]\n\nConvert ChatGPT exports to open-webui JSON\n```\n\n### convert_grok.py\n\n```\nusage: convert_grok.py [-h] --userid USERID [--output-dir OUTPUT_DIR] files [files ...]\n\nConvert Grok exports to open-webui JSON\n```\n\n### convert_claude.py\n\n```\nusage: convert_claude.py [-h] --userid USERID [--output-dir OUTPUT_DIR] files [files ...]\n\nConvert Claude exports to open-webui JSON\n```\n\nAll converter scripts name the output files using the original conversation ID\nso running them again will produce the same filename for the same conversation.\nConverted files are saved in a subdirectory named after the model (for example\n`output/grok` or `output/claude`).\n\n### create_sql.py\n\n```\nusage: create_sql.py [-h] [--tags TAGS] [--output OUTPUT] files [files ...]\n\nCreate SQL inserts for open-webui chats. Existing chat records are deleted\nbefore inserting so they are replaced if already present. Tags are inserted\nwith UPSERT statements, ensuring the default import tags (and any tags passed\nvia `--tags`) exist for each user.\n\npositional arguments:\n  files            Chat JSON files or directories\n\noptions:\n  -h, --help       show this help message and exit\n  --tags TAGS      Comma-separated tags for the meta field\n  --output OUTPUT  Write SQL statements to this file\n```\n\n### create-schema.py\nJSON schemas were originally used with the Model's export JSON. This script and the schemas are kept for reference.\n\n```\nUsage: python json_schema_generator.py \u003cinput_json_file\u003e\nOutput will be saved as \u003cinput_file\u003e_schema.json\n```\n\n## Example workflow\n\n1. Create an export from Claude, ChatGPT or Grok.\n2. Unzip the archive and locate the JSON file (for Grok this is `prod-grok-backend.json`).\n3. Convert the export to open-webui JSON using the appropriate script:\n   ```bash\n   python ./convert_grok.py --userid=\"d95194d2-9cef-4387-8ee4-b82eb2e1c637\" ./grok.json\n   ```\n   The converter writes JSON files to a subdirectory such as `output/grok`.\n4. Generate SQL statements from the converted JSON files:\n   ```bash\n   python ./create_sql.py ./output --tags=\"imported-grok\" --output=grok.sql\n   ```\n   The resulting SQL removes any existing chats with the same IDs before\n   inserting new ones, while tags are inserted using UPSERTs so they are\n   updated if they already exist. Any tags passed with `--tags` are also created\n   for each user.\n5. Make a copy of your `webui.db` database.\n6. Execute the generated SQL using a tool such as [DB Browser for SQLite](https://sqlitebrowser.org/dl/). Ensure you save the database.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetanotherchris%2Fopenwebui-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyetanotherchris%2Fopenwebui-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyetanotherchris%2Fopenwebui-importer/lists"}