GitHub user dosubot[bot] added a comment to the discussion: Transfer role from superset 4.0.2 to superset 6.0.0
<!-- Answer --> There’s no built-in export/import for roles between Superset versions, and direct database copying isn’t recommended due to schema and permission model changes in 6.0.0. The recommended approach is to upgrade your Superset instance (including the metadata database), then use the role duplication feature in the Superset UI or the REST API to copy your custom role. This creates a new role with the same permissions as your original one, so you don’t have to recreate it from scratch ([source](https://github.com/apache/superset/blob/master/superset-frontend/src/features/roles/RoleListDuplicateModal.tsx), [API details](https://github.com/apache/superset/blob/master/superset-frontend/src/features/roles/utils.ts)). After upgrading, run `superset init` to resync all roles and permissions and ensure everything is up to date ([source](https://github.com/apache/superset/issues/36485)). Because of breaking changes in Superset 6.0’s RBAC model, review the duplicated role’s permissions to make sure they match your intended access ([source](https://github.com/apache/superset/issues/32116)). If you need to automate this for multiple roles, you can use the REST API to create and assign permissions programmatically. Note: Role associations (like which dashboards a role can access) are not preserved during export/import, so you’ll need to reassign roles to dashboards or users after migration ([source](https://github.com/apache/superset/issues/36110)). <!-- 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/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/dac8674b-b52f-4c69-a9ec-08a5a041e314?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=There%E2%80%99s%20no%20built-in%20export/import%20for%20roles%20between%20Superset%20versions%2C%20and%20direct%20database%20copying%20isn%E2%80%99t%20recommended%20due%20to%20schema%20and%20permission%20model%20changes%20in%206.0.0.%20The%20recommended%20approach%20is%20to%20upgrade%20your%20Superset%20instance%20%28including%20the%20metadata%20database%29%2C%20then%20use%20the%20role%20duplication%20feature%20in%20the%20Superset%20UI%20or%20the%20REST%20API%20to%20copy%20your%20custom%20role.%20This%20creates%20a%20new%20role%20with%20the%20same%20permissions%20as%20your%20original%20one%2C%20so%20you%20don%E2%80%99t%20have%20to%20recreate%20it%20from%20scratch%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend /src/features/roles/RoleListDuplicateModal.tsx%29%2C%C2%A0%5BAPI%20details%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/src/features/roles/utils.ts%29%29.%0A%0AAfter%20upgrading%2C%20run%20%60superset%20init%60%20to%20resync%20all%20roles%20and%20permissions%20and%20ensure%20everything%20is%20up%20to%20date%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/issues/36485%29%29.%20Because%20of%20breaking%20changes%20in%20Superset%206.0%E2%80%99s%20RBAC%20model%2C%20review%20the%20duplicated%20role%E2%80%99s%20permissions%20to%20make%20sure%20they%20match%20your%20intended%20access%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/issues/32116%29%29.%20If%20you%20need%20to%20automate%20this%20for%20multiple%20roles%2C%20you%20can%20use%20the%20REST%20API%20to%20create%20and%20assign%20permissions%20programmatically.%0A%0ANote%3A%20Role%20associations%20%28like%20which%20dashboards%20a%20role%20can%20access%29%20are%20not%20preserved%20durin g%20export/import%2C%20so%20you%E2%80%99ll%20need%20to%20reassign%20roles%20to%20dashboards%20or%20users%20after%20migration%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/issues/36110%29%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/37283) GitHub link: https://github.com/apache/superset/discussions/37283#discussioncomment-15548573 ---- 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]
