GitHub user dosubot[bot] added a comment to the discussion: apache super set db migration issue
<!-- Answer --> Yes, if you share the exact Alembic migration ID from your backup (check the `alembic_version` table in your metadata DB), I can help you determine which Superset release/tag matches that migration state. Each Superset release expects the metadata DB to be at a specific Alembic revision—if your backup's revision matches an official migration head, you can check out that Superset version, run `superset db upgrade` (or `downgrade` if needed), and your DB should work without migration errors ([example](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/migrations/versions/2025-01-08_09-34_d482d51c15ca_remove_legacy_plugins_5_0.py), [discussion](https://github.com/apache/superset/discussions/34579)). If your migration ID is from a dev or custom build (not present in the official release), direct restoration won’t work—Superset won’t recognize the migration chain. In that case, the safest workaround is to manually downgrade your DB to the last known good revision (e.g., `superset db downgrade <revision>`) that exists in the target release, then run `superset db upgrade` and `superset init` ([details](https://github.com/apache/superset/discussions/34579), [issue](https://github.com/apache/superset/issues/33739)). Always back up your metadata DB before running these commands. If you want, paste the migration ID here and I’ll check which release/tag you need to run, or guide you through the downgrade/upgrade process. If the migration ID is missing from all official releases, you may need to manually edit the `alembic_version` table or use the export/import workaround. Let me know the migration ID and I’ll help you map it to the right Superset version or next steps! <!-- 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/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/87f6d643-f874-401a-b7b5-cfd84206372f?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Yes%2C%20if%20you%20share%20the%20exact%20Alembic%20migration%20ID%20from%20your%20backup%20%28check%20the%20%60alembic_version%60%20table%20in%20your%20metadata%20DB%29%2C%20I%20can%20help%20you%20determine%20which%20Superset%20release/tag%20matches%20that%20migration%20state.%20Each%20Superset%20release%20expects%20the%20metadata%20DB%20to%20be%20at%20a%20specific%20Alembic%20revision%E2%80%94if%20your%20backup%27s%20revision%20matches%20an%20official%20migration%20head%2C%20you%20can%20check%20out%20that%20Superset%20version%2C%20run%20%60superset%20db%20upgrade%60%20%28or%20%60downgrade%60%20if%20needed%29%2C%20and%20your%20DB%20should%20work%20without%20migration%20errors%C2%A0%28%5Bexample%5D%28https%3A//github.com/apache/superset/blob/829e4d92d 91ceae4b43b1ed3b063ffe45377799c/superset/migrations/versions/2025-01-08_09-34_d482d51c15ca_remove_legacy_plugins_5_0.py%29%2C%20%5Bdiscussion%5D%28https%3A//github.com/apache/superset/discussions/34579%29%29.%0A%0AIf%20your%20migration%20ID%20is%20from%20a%20dev%20or%20custom%20build%20%28not%20present%20in%20the%20official%20release%29%2C%20direct%20restoration%20won%E2%80%99t%20work%E2%80%94Superset%20won%E2%80%99t%20recognize%20the%20migration%20chain.%20In%20that%20case%2C%20the%20safest%20workaround%20is%20to%20manually%20downgrade%20your%20DB%20to%20the%20last%20known%20good%20revision%20%28e.g.%2C%20%60superset%20db%20downgrade%20%3Crevision%3E%60%29%20that%20exists%20in%20the%20target%20release%2C%20then%20run%20%60superset%20db%20upgrade%60%20and%20%60superset%20init%60%C2%A0%28%5Bdetails%5D%28https%3A//github.com/apache/superset/discussions/34579%29%2C%20%5Bissue%5D%28https%3A//github.com/apache/superset/issues/33739%29%29.%20Always%20back%20up%20your%20metadata%20DB%20bef ore%20running%20these%20commands.%0A%0AIf%20you%20want%2C%20paste%20the%20migration%20ID%20here%20and%20I%E2%80%99ll%20check%20which%20release/tag%20you%20need%20to%20run%2C%20or%20guide%20you%20through%20the%20downgrade/upgrade%20process.%20If%20the%20migration%20ID%20is%20missing%20from%20all%20official%20releases%2C%20you%20may%20need%20to%20manually%20edit%20the%20%60alembic_version%60%20table%20or%20use%20the%20export/import%20workaround.%0A%0ALet%20me%20know%20the%20migration%20ID%20and%20I%E2%80%99ll%20help%20you%20map%20it%20to%20the%20right%20Superset%20version%20or%20next%20steps%21) [](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/37232) GitHub link: https://github.com/apache/superset/discussions/37232#discussioncomment-15537531 ---- 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]
