Migration from 3.6 to 6.2

I’m not sure what you mean by trytond-migration but you must execute trytond-admin --all (using the target version) with success before running the post trytond-console scripts.

With trytond-migration I meant running trytond-admin … –all

In both cases (trytond-console, trytond-migration) I am running into the mentioned issue. Somehow ir_module is expected, but there is only ir_module_module in the database.

Well this means that the upgrade to 6.0 series was not complete.
In series 3.8, the tables has been renamed: Rename ir.module.module* into ir.module* (98bcb2ee56c2) · Commits · Tryton / Tryton · GitLab (we are talking about changes made 11 years ago).

FYI: you must perform a complete upgrade to each major series.

something went wrong when I did the manual migration steps. Also the situation was a little bit confusing as chatgpt was quite sure that ir_module_module is the current correct name. Seems like it is using an old documentation. I somehow fixed this issue, by doing the manual migration again.

Now there is a new issue when running trytond-admin:

psycopg2.errors.ForeignKeyViolation: insert or update on table "ir_ui_view_tree_width" violates foreign key constraint "ir_ui_view_tree_width_field_model_name_model_fkey"
DETAIL:  Key (field, model)=(vat_code, party.party) is not present in table "ir_model_field".

Why trusting such statistic tool for real information.
LLM’s will never be a source of trust.

This is an old issue. But coming from your version I do not think it makes any sense to try to keep the tree view width preferences. So it will be simpler to just delete all records in this table.