GitHub user dosubot[bot] added a comment to the discussion: apache super set db migration issue
<!-- Answer --> Here’s what I found: - Alembic migration ID **f5b5f88d8526** is the migration head for Superset **6.0.0 or later**. If your backup’s alembic_version is set to this, you should use Superset 6.0.0+ to restore and run your database without migration errors. [Reference](https://github.com/apache/superset/pull/36680) - Alembic migration ID **c233f5365c9e** is **not part of any official Superset release** or migration script. It does not appear in the official codebase, migration history, or any merged pull request. This usually means it’s from a dev build, a custom branch, or a local migration that never made it into a release. [Reference](https://github.com/apache/superset/issues/32846) If you need to restore a backup with c233f5365c9e, direct restoration into any official Superset release will fail with Alembic errors. Your options are: 1. **Manual Downgrade:** If you know the last official migration in your chain (for example, the migration head for 5.0.0 is `d482d51c15ca`), you can try downgrading your database to that revision using `superset db downgrade d482d51c15ca`, then upgrade again. Always back up your metadata DB first. 2. **Export/Import:** Use Superset’s export/import commands to move dashboards, datasets, etc., to a clean official release. You may need to manually clean up metadata files if you hit schema errors. 3. **(Advanced, Not Recommended)**: Manually edit the alembic_version table to match an official revision, but this is risky and can corrupt your DB if the schema doesn’t match. For future migrations, always match your Superset code version and DB migration head, avoid running production on dev builds, and keep regular backups. Let me know if you want step-by-step instructions for any of these options. <!-- 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/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3078ecfb-6088-4ceb-a9b2-bd17ceb782ae?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Here%E2%80%99s%20what%20I%20found%3A%0A%0A-%20Alembic%20migration%20ID%20%2A%2Af5b5f88d8526%2A%2A%20is%20the%20migration%20head%20for%20Superset%20%2A%2A6.0.0%20or%20later%2A%2A.%20If%20your%20backup%E2%80%99s%20alembic_version%20is%20set%20to%20this%2C%20you%20should%20use%20Superset%206.0.0%2B%20to%20restore%20and%20run%20your%20database%20without%20migration%20errors.%20%20%0A%20%20%5BReference%5D%28https%3A//github.com/apache/superset/pull/36680%29%0A%0A-%20Alembic%20migration%20ID%20%2A%2Ac233f5365c9e%2A%2A%20is%20%2A%2Anot%20part%20of%20any%20official%20Superset%20release%2A%2A%20or%20migration%20script.%20It%20does%20not%20appear%20in%20the%20official%20codebase%2C%20migration%20history%2C%20or%20any%20merged%20pull%20request.%20This%20usually% 20means%20it%E2%80%99s%20from%20a%20dev%20build%2C%20a%20custom%20branch%2C%20or%20a%20local%20migration%20that%20never%20made%20it%20into%20a%20release.%20%20%0A%20%20%5BReference%5D%28https%3A//github.com/apache/superset/issues/32846%29%0A%0AIf%20you%20need%20to%20restore%20a%20backup%20with%20c233f5365c9e%2C%20direct%20restoration%20into%20any%20official%20Superset%20release%20will%20fail%20with%20Alembic%20errors.%20Your%20options%20are%3A%0A%0A1.%20%2A%2AManual%20Downgrade%3A%2A%2A%20If%20you%20know%20the%20last%20official%20migration%20in%20your%20chain%20%28for%20example%2C%20the%20migration%20head%20for%205.0.0%20is%20%60d482d51c15ca%60%29%2C%20you%20can%20try%20downgrading%20your%20database%20to%20that%20revision%20using%20%60superset%20db%20downgrade%20d482d51c15ca%60%2C%20then%20upgrade%20again.%20Always%20back%20up%20your%20metadata%20DB%20first.%0A2.%20%2A%2AExport/Import%3A%2A%2A%20Use%20Superset%E2%80%99s%20export/import%20commands%20to%20move%20dashboards%2C%20datase ts%2C%20etc.%2C%20to%20a%20clean%20official%20release.%20You%20may%20need%20to%20manually%20clean%20up%20metadata%20files%20if%20you%20hit%20schema%20errors.%0A3.%20%2A%2A%28Advanced%2C%20Not%20Recommended%29%2A%2A%3A%20Manually%20edit%20the%20alembic_version%20table%20to%20match%20an%20official%20revision%2C%20but%20this%20is%20risky%20and%20can%20corrupt%20your%20DB%20if%20the%20schema%20doesn%E2%80%99t%20match.%0A%0AFor%20future%20migrations%2C%20always%20match%20your%20Superset%20code%20version%20and%20DB%20migration%20head%2C%20avoid%20running%20production%20on%20dev%20builds%2C%20and%20keep%20regular%20backups.%0A%0ALet%20me%20know%20if%20you%20want%20step-by-step%20instructions%20for%20any%20of%20these%20options.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20so lve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37232) GitHub link: https://github.com/apache/superset/discussions/37232#discussioncomment-15537974 ---- 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]
