GitHub user A-little-bit-of-data added a comment to the discussion: How to 
import postgresql data from 2.1 to 4.1

> Hi @A-little-bit-of-data! 👋 I'm here to help you solve bugs, answer 
> questions, and assist you while you wait for a human maintainer. Let’s tackle 
> your PostgreSQL migration issue together!
> 
> I found a similar unsolved discussion regarding PostgreSQL not starting when 
> using Helm install, which might be related to your issue. You can check it 
> out [here](https://github.com/apache/superset/discussions/26961) 
> [[1]](https://github.com/apache/superset/discussions/26961).
> 
> To address your specific concerns:
> 
> 1. **Inconsistent PostgreSQL Versions**: The inconsistency in PostgreSQL 
> versions between `superset/values.yaml` and 
> `superset/charts/postgresql/values.yaml` might be due to different default 
> configurations or updates in the Helm chart. It's important to ensure that 
> the PostgreSQL version you are using is compatible with your data directory. 
> Since version 16.1.0-debian-11-r25 works for you, you should continue using 
> it.
> 2. **Migration Process**: When upgrading PostgreSQL versions, you need to 
> ensure that the data directory is compatible with the new version. The error 
> you encountered indicates a version mismatch. Here’s a general approach to 
> migrate your data:
>    
>    * **Backup your data**: Use `pg_dump` to create a backup of your current 
> database. Ensure that you are using the correct options to avoid errors 
> during `pg_restore`.
>      ```shell
>      pg_dump -Fc -h superset-postgresql -p 5432 -U superset -d 
> your_database_name > /tmp/superset_backup.dump
>      ```
>    * **Restore your data**: After setting up the new PostgreSQL instance, use 
> `pg_restore` to import the data. Make sure the target database is prepared to 
> accept the data.
>      ```shell
>      pg_restore -h new-superset-postgresql -p 5432 -U superset -d 
> your_new_database_name /tmp/superset_backup.dump
>      ```
>    * **Run Superset Migrations**: After restoring the database, run the 
> following commands to upgrade the Superset metadata:
>      ```shell
>      superset db upgrade
>      superset init
>      ```
> 
> Ensure that you have the necessary permissions and that your environment 
> variables are correctly set for the database connections. If you encounter 
> specific errors during `pg_restore`, they might need to be addressed 
> individually based on the error messages.
> 
> _To continue talking to [Dosu](https://dosu.dev), mention @dosu._
> 
> Help Dosu learn! Give it feedback: [Great 
> Response](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=great_response)
>  | [Irrelevant 
> Answer](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=irrelevant_answer)
>  | [Incorrect 
> Sources](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=incorrect_sources)
>  | [Too 
> Verbose](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=too_verbose)
>  | 
> [Hallucination](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=hallucination)
>  | [Bug 
> Report](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=bug_report)
>  | 
> [Other](https://app.dosu.dev/response-feedback/89b432d2-48e5-43fa-af2e-308fba2659e2?feedback_type=other)

Or I tried to restore the data using `pg_restore --clean --if-exists -h`. The 
data was restored successfully, but errors were reported from time to time on 
the webui, such as: `There was an error fetching the filtered charts and 
dashboards:` ` There was an issue fetching your dashboards: [object Response]`
and sqllab could not be opened, displaying `Unexpected error`

GitHub link: 
https://github.com/apache/superset/discussions/33039#discussioncomment-12766004

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