GitHub user dosubot[bot] added a comment to the discussion: I have the superset 
5 metastore , now I need to migrate to superset 6 , what commands need to be 
run on superset metastore to not lose any data from superset 5 , including 
roles , users etc

<!-- Answer -->
To migrate from Superset 5 to Superset 6 without losing data, follow these 
steps:

**1. Backup your metadata database first** (critical before any upgrade)

**2. Upgrade to the latest 5.x minor version first** - [per Superset's 
migration 
guidelines](https://github.com/apache/superset/wiki/Semantic-Versioning), you 
should be on the latest minor version before jumping to a major version.

**3. Run the standard migration commands:**
```bash
superset db upgrade
superset init
```

The `superset db upgrade` command applies all schema migrations via Alembic, 
preserving your existing data including dashboards, charts, roles, users, and 
saved queries.

**Important considerations:**

- **Roles and users are preserved** through the standard migration process - 
Superset uses Alembic migrations that transform the schema while keeping your 
data intact.

- **Custom CSS will break** - [Superset 6.x migrated to Ant Design v5 and 
Emotion CSS-in-JS](https://github.com/apache/superset/discussions/37504), so 
any custom CSS overrides from 5.x will need to be updated.

- **Alternative for complex migrations** - If you're doing a major version jump 
or encounter issues, you can use [CLI export/import 
commands](https://github.com/apache/superset/discussions/37232) instead:
  ```bash
  # Export from old version
  superset export_dashboards --dashboard-file /tmp/dashboards.zip
  superset export_datasources --datasource-file /tmp/datasources.zip
  
  # Import to new version
  superset import_dashboards --path /tmp/dashboards.zip --username admin
  superset import_datasources --path /tmp/datasources.zip --username admin
  ```
  Note: Database passwords are not exported for security reasons - you'll need 
to re-enter them manually.

- **Large deployments** - [Migration time scales with the number of 
dashboards/charts](https://github.com/apache/superset/discussions/37261), so 
plan accordingly for off-peak hours.


<!-- 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/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/d59a6de9-677a-44f8-b510-ec19a2fbe75f?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=To%20migrate%20from%20Superset%205%20to%20Superset%206%20without%20losing%20data%2C%20follow%20these%20steps%3A%0A%0A%2A%2A1.%20Backup%20your%20metadata%20database%20first%2A%2A%20%28critical%20before%20any%20upgrade%29%0A%0A%2A%2A2.%20Upgrade%20to%20the%20latest%205.x%20minor%20version%20first%2A%2A%20-%20%5Bper%20Superset%27s%20migration%20guidelines%5D%28https%3A//github.com/apache/superset/wiki/Semantic-Versioning%29%2C%20you%20should%20be%20on%20the%20latest%20minor%20version%20before%20jumping%20to%20a%20major%20version.%0A%0A%2A%2A3.%20Run%20the%20standard%20migration%20commands%3A%2A%2A%0A%60%60%60bash%0Asuperset%20db%20upgrade%0Asuperset%20init%0A%60%60%60%0A%0AThe%20%60superset%20db%20upgrade%60%20command%20applies%20all%20schema%20migration
 
s%20via%20Alembic%2C%20preserving%20your%20existing%20data%20including%20dashboards%2C%20charts%2C%20roles%2C%20users%2C%20and%20saved%20queries.%0A%0A%2A%2AImportant%20considerations%3A%2A%2A%0A%0A-%20%2A%2ARoles%20and%20users%20are%20preserved%2A%2A%20through%20the%20standard%20migration%20process%20-%20Superset%20uses%20Alembic%20migrations%20that%20transform%20the%20schema%20while%20keeping%20your%20data%20intact.%0A%0A-%20%2A%2ACustom%20CSS%20will%20break%2A%2A%20-%20%5BSuperset%206.x%20migrated%20to%20Ant%20Design%20v5%20and%20Emotion%20CSS-in-JS%5D%28https%3A//github.com/apache/superset/discussions/37504%29%2C%20so%20any%20custom%20CSS%20overrides%20from%205.x%20will%20need%20to%20be%20updated.%0A%0A-%20%2A%2AAlternative%20for%20complex%20migrations%2A%2A%20-%20If%20you%27re%20doing%20a%20major%20version%20jump%20or%20encounter%20issues%2C%20you%20can%20use%20%5BCLI%20export/import%20commands%5D%28https%3A//github.com/apache/superset/discussions/37232%29%20instead%3A%0A%20%20
 
%60%60%60bash%0A%20%20%23%20Export%20from%20old%20version%0A%20%20superset%20export_dashboards%20--dashboard-file%20/tmp/dashboards.zip%0A%20%20superset%20export_datasources%20--datasource-file%20/tmp/datasources.zip%0A%20%20%0A%20%20%23%20Import%20to%20new%20version%0A%20%20superset%20import_dashboards%20--path%20/tmp/dashboards.zip%20--username%20admin%0A%20%20superset%20import_datasources%20--path%20/tmp/datasources.zip%20--username%20admin%0A%20%20%60%60%60%0A%20%20Note%3A%20Database%20passwords%20are%20not%20exported%20for%20security%20reasons%20-%20you%27ll%20need%20to%20re-enter%20them%20manually.%0A%0A-%20%2A%2ALarge%20deployments%2A%2A%20-%20%5BMigration%20time%20scales%20with%20the%20number%20of%20dashboards/charts%5D%28https%3A//github.com/apache/superset/discussions/37261%29%2C%20so%20plan%20accordingly%20for%20off-peak%20hours.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![S
 hare 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/38287)

GitHub link: 
https://github.com/apache/superset/discussions/38287#discussioncomment-15943157

----
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]

Reply via email to