Migration from 3.6 to 6.2

As I already said, you must first have your custom modules working properly on the target version (with tests) before thinking about upgrading the data.

yes I would do that if there would be tests available.

Do not blame us, blame the author of those modules.

I don’t blame anyone, sry if this was badly communicated. I appreciate the work you do and the help that I receive via this forum.

Its definitely on my list to write some tests once I get a better understanding of tryton and the modules we use at work, so it will be easier to update our modules.

Actually I think it’s not too much missing for us to have a working tryton5.0 with our database. The problem with the missing invoices seems to be an empty table of the database. To me it seems like the invoices were not copied into the dump


The upgrade process is not copying anything, it alters the database in-place.

I would like to continue the migration to the latest available version (7.6). Is it possible to go from 5.0 to 7.6 directly or do i need to have a version in between installed?

not all is running with 5.0. But I would like to update to 7.6 first and then try to fix the remaining issues.

You can not skip two LTS series. In this case you must update to one of them.

so this means I need to go to 6.0 before going to the latest available version?

Or 7.0.
See Migration — Tryton Documentation

A post was split to a new topic: Setting up a development environment for tryton

as I need to make some changes with the trytond-console after 6.0 [1] I decided to go to 6.0 first. But now I am running into some issues doing the trytond-admin migration:

74 140252598083648 [2025-11-20 16:05:28,166] INFO trytond.modules ir:register ir.configuration
Traceback (most recent call last):
  File "/usr/local/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/usr/local/lib/python3.11/dist-packages/trytond/admin.py", line 53, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/local/lib/python3.11/dist-packages/trytond/pool.py", line 164, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 441, in load_modules
    _load_modules(update)
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 411, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 238, in load_module_graph
    cls.__register__(module)
  File "/usr/local/lib/python3.11/dist-packages/trytond/model/modelsql.py", line 223, in __register__
    super(ModelSQL, cls).__register__(module_name)
  File "/usr/local/lib/python3.11/dist-packages/trytond/model/model.py", line 126, in __register__
    ModelField.register(cls, module_name, model_id)
  File "/usr/local/lib/python3.11/dist-packages/trytond/ir/model.py", line 277, in register
    cursor.execute(*ir_model_field.join(ir_model,
  File "/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py", line 74, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UndefinedColumn: column a.access does not exist
LINE 1: ..., "a"."module" AS "module", "a"."help" AS "help", "a"."acces...

[1] Migration — Tryton Documentation

You seem to not have execute the first “before” SQL query of 6.0.

1 Like

true. Now I am running into this issue:

101 140247256293440 [2025-11-20 16:21:20,550] INFO trytond.modules product:register product.product
Traceback (most recent call last):
  File "/usr/local/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/usr/local/lib/python3.11/dist-packages/trytond/admin.py", line 53, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/local/lib/python3.11/dist-packages/trytond/pool.py", line 164, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 441, in load_modules
    _load_modules(update)
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 411, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 238, in load_module_graph
    cls.__register__(module)
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/product/product.py", line 422, in __register__
    super().__register__(module)
  File "/usr/local/lib/python3.11/dist-packages/trytond/model/modelsql.py", line 313, in __register__
    table.add_constraint(ident, constraint)
  File "/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/table.py", line 489, in add_constraint
    cursor.execute(
  File "/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py", line 74, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.ExclusionViolation: could not create exclusion constraint "product_product_code_exclude"
DETAIL:  Key (code)=(1105220) conflicts with key (code)=(1105220).

With Use product code as SKU (#9004) · Issues · Tryton / Tryton · GitLab, it was decided to make product code unique. You must fix your existing data to this constraint prior to update to 5.6.

1 Like

A post was split to a new topic: Use thunderbird -compose

I am now trying to upgrade from 6.0 to 7.8. I did the sql migration (I wasn’t able to do the migration with the trytond-console). When I run the trytond-migration I get the following error:

psycopg2.errors.UndefinedTable: relation "ir_module" does not exist
LINE 1: SELECT "a"."name" FROM "ir_module" AS "a" WHERE ("a"."state"...

when i try to launch the trytond console I get the following error:

trytond-console -d mydatabase
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/trytond/transaction.py", line 193, in start
    database = backend.Database(database_name).connect()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/trytond/backend/sqlite/database.py", line 468, in connect
    self._make_uri(), uri=True,
    ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/trytond/backend/sqlite/database.py", line 547, in _make_uri
    raise IOError("Database '%s' doesn't exist!" % db_path)
OSError: Database '/root/db/mydatabase.sqlite' doesn't exist!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/trytond-console", line 30, in <module>
    console.run(options)
  File "/usr/local/lib/python3.11/dist-packages/trytond/console.py", line 45, in run
    with Transaction().start(db_name, 0, readonly=True):
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/trytond/transaction.py", line 238, in start
    self.stop(False)
  File "/usr/local/lib/python3.11/dist-packages/trytond/transaction.py", line 257, in stop
    self.rollback()
  File "/usr/local/lib/python3.11/dist-packages/trytond/transaction.py", line 395, in rollback
    for datamanager in self._datamanagers:
                       ^^^^^^^^^^^^^^^^^^
AttributeError: 'Transaction' object has no attribute '_datamanagers'

You must start trytond-console with the same configuration as trytond otherwise it will not be able to connect correctly to the database.

thanks, yes I had a problem with the trytond.conf.

I am a little bit confused. Now when I try to start the trytond-console I get this:

trytond-console -d mydatabase
/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py:256: UserWarning: The path specified in the URI will be overridden
  warnings.warn("The path specified in the URI will be overridden")
Traceback (most recent call last):
  File "/usr/local/bin/trytond-console", line 30, in <module>
    console.run(options)
  File "/usr/local/lib/python3.11/dist-packages/trytond/console.py", line 46, in run
    pool.init()
  File "/usr/local/lib/python3.11/dist-packages/trytond/pool.py", line 148, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 487, in load_modules
    _load_modules(update)
  File "/usr/local/lib/python3.11/dist-packages/trytond/modules/__init__.py", line 438, in _load_modules
    cursor.execute(*ir_module.select(ir_module.name,
  File "/usr/local/lib/python3.11/dist-packages/trytond/backend/postgresql/database.py", line 74, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UndefinedTable: relation "ir_module" does not exist
LINE 1: SELECT "a"."name" FROM "ir_module" AS "a" WHERE ("a"."state"...

in my database is only `ir_module_module`.

You must run trytond-console on a database that is at the same version as the tool.
The migration that requires to run trytond-console must be run after the update.

I did all the steps (not dependent on trytond-console) from 6.0 to 7.8. After that I tried to run the trytond-migration (but this failed) and also the trytond-console failed due to the mentioned problem.

So you mean I have to run every version of trytond where the trytond-console is needed for the migration (6.0 →7.0→7.6→7.8) ?

I am wondering a bit about this line: