GitHub user dosubot[bot] added a comment to the discussion: apache super set db migration issue
<!-- Answer --> Your data disappears and the Alembic version changes to c233f5365c9e because the migration scripts in your container and your database state are out of sync. The revision c233f5365c9e is not part of any official Superset release—it likely comes from a dev build or custom migration, so the official Docker image can't recognize it and may re-initialize or corrupt the DB during migration, causing data loss [details](https://github.com/apache/superset/issues/32846). To recover and prevent this: 1. **Stop all containers and back up your metadata DB immediately** to avoid further data loss. 2. **Restore your DB from a backup** taken before the failed migration (when data and Alembic version were correct, e.g., f5b5f88d8526). 3. **Ensure your local code and Docker image are both at the 6.0.0 tag**. Double-check that your local ./docker directory is clean and matches the 6.0.0 tag exactly—no extra files or changes. 4. **Remove all Docker volumes** to clear any corrupted state: ```bash docker compose -f docker-compose-image-tag.yaml down -v ``` 5. **Start your containers again**: ```bash docker compose -f docker-compose-image-tag.yaml up ``` 6. **Verify your DB is at the correct Alembic head (f5b5f88d8526)** and your data is present. If you still see issues or the DB is at an unknown revision, use Superset’s export/import CLI tools (with manual metadata cleanup if needed) to recover dashboards and datasets from a backup or previous export. For future upgrades: always back up before migrations, align your code and image tags, avoid mounting mismatched directories, and verify migration scripts before running upgrades [reference](https://github.com/apache/superset/issues/34284). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/99549fc3-f20c-445f-8d5a-65aed44f8f5b?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Your%20data%20disappears%20and%20the%20Alembic%20version%20changes%20to%20c233f5365c9e%20because%20the%20migration%20scripts%20in%20your%20container%20and%20your%20database%20state%20are%20out%20of%20sync.%20The%20revision%20c233f5365c9e%20is%20not%20part%20of%20any%20official%20Superset%20release%E2%80%94it%20likely%20comes%20from%20a%20dev%20build%20or%20custom%20migration%2C%20so%20the%20official%20Docker%20image%20can%27t%20recognize%20it%20and%20may%20re-initialize%20or%20corrupt%20the%20DB%20during%20migration%2C%20causing%20data%20loss%C2%A0%5Bdetails%5D%28https%3A//github.com/apache/superset/issues/32846%29.%0A%0ATo%20recover%20and%20prevent%20this%3A%0A%0A1.%20%2A%2AStop%20all%20containers%20and%20back%20up%20your%20metadata%20DB%20immediatel y%2A%2A%20to%20avoid%20further%20data%20loss.%0A2.%20%2A%2ARestore%20your%20DB%20from%20a%20backup%2A%2A%20taken%20before%20the%20failed%20migration%20%28when%20data%20and%20Alembic%20version%20were%20correct%2C%20e.g.%2C%20f5b5f88d8526%29.%0A3.%20%2A%2AEnsure%20your%20local%20code%20and%20Docker%20image%20are%20both%20at%20the%206.0.0%20tag%2A%2A.%20Double-check%20that%20your%20local%20./docker%20directory%20is%20clean%20and%20matches%20the%206.0.0%20tag%20exactly%E2%80%94no%20extra%20files%20or%20changes.%0A4.%20%2A%2ARemove%20all%20Docker%20volumes%2A%2A%20to%20clear%20any%20corrupted%20state%3A%0A%20%20%20%60%60%60bash%0A%20%20%20docker%20compose%20-f%20docker-compose-image-tag.yaml%20down%20-v%0A%20%20%20%60%60%60%0A5.%20%2A%2AStart%20your%20containers%20again%2A%2A%3A%0A%20%20%20%60%60%60bash%0A%20%20%20docker%20compose%20-f%20docker-compose-image-tag.yaml%20up%0A%20%20%20%60%60%60%0A6.%20%2A%2AVerify%20your%20DB%20is%20at%20the%20correct%20Alembic%20head%20%28f5b5f88d8526%29% 2A%2A%20and%20your%20data%20is%20present.%0A%0AIf%20you%20still%20see%20issues%20or%20the%20DB%20is%20at%20an%20unknown%20revision%2C%20use%20Superset%E2%80%99s%20export/import%20CLI%20tools%20%28with%20manual%20metadata%20cleanup%20if%20needed%29%20to%20recover%20dashboards%20and%20datasets%20from%20a%20backup%20or%20previous%20export.%0A%0AFor%20future%20upgrades%3A%20always%20back%20up%20before%20migrations%2C%20align%20your%20code%20and%20image%20tags%2C%20avoid%20mounting%20mismatched%20directories%2C%20and%20verify%20migration%20scripts%20before%20running%20upgrades%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/34284%29.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/3 7232) GitHub link: https://github.com/apache/superset/discussions/37232#discussioncomment-15539796 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
