GitHub user dosubot[bot] added a comment to the discussion: Unable to migrate db

<!-- Answer -->
The error you're seeing during the upgrade to 3.1.3 is due to a migration that 
tries to drop the PostgreSQL enum type tagtypes, but the type is still in use 
by the tag table. This is a known issue that was addressed in later migrations: 
Superset now only attempts to drop types if they exist and are not in use, and 
also converts the tag column from enum to varchar to avoid these dependency 
problems ([changelog 
reference](https://github.com/apache/superset/blob/master/CHANGELOG/3.0.0.md)).

If you are stuck on this migration, it's likely because your database still has 
the tag table or column using the tagtypes enum. This can happen if the 
migration that converts the enum to varchar did not run successfully, or if 
there are legacy artifacts in your schema.

To resolve this:

1. Inspect your tag table and confirm if the type of the relevant column is 
still tagtypes (enum). If so, you may need to manually alter the column to 
varchar before running the migration again.
2. If you have customizations or legacy objects using tagtypes, consider 
updating or removing them.
3. Always back up your database before making manual changes.

If migration continues to fail, you can use the legacy_import_datasources 
command in Superset 4.x.x to export your datasources from the old version and 
import them into the new version as JSON files, bypassing problematic schema 
migrations 
([docs](https://github.com/apache/superset/blob/master/docs/docs/configuration/importing-exporting-datasources.mdx)).

If you encounter permission errors or issues with SQL Lab after upgrading to 
3.1.3, these are due to a permission renaming that occurred without a 
corresponding migration. You can work around this by manually updating the 
permission names in your database ([issue 
reference](https://github.com/apache/superset/issues/31461)).

Let me know if you need more detailed steps for any of these actions.


<!-- Dosu Comment Footer -->
*To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/1fc0ca55-4c3f-41cc-8bd9-c550951a4617?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Sh
 are on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/33616)

GitHub link: 
https://github.com/apache/superset/discussions/33616#discussioncomment-13309116

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to