- Mailing Lists
- Contributors
- Re: Removal of migration scripts on each new version
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Re: Removal of migration scripts on each new version
Re: Removal of migration scripts on each new version
Re: Removal of migration scripts on each new version
[Stefan wrote] > True. Maybe a saner option would be to just always keep them, for say three versions (matching Odoo version lifecycle, c.q. maximum upgrade cycle).
With this, OCA issue trackers will be full of issues saying that the module X breaks their Odoo.sh build/test/migration, due to the already explained reasons to fail.
So I think Pedro and Stefan both have a point:
- Stefan is correct in saying that in some cases, maybe even in most cases, having the migration script there will do the right thing for odoo.sh migrations that skip versions
- Pedro is correct in saying that if we leave the migration script there, we'll have multiple versions of truth for the lower-version migration scripts, and even if it's the latest version it might still fail for all kinds of reasons
From our own experience at Therp, there is currently no "correct" way of doing multiple-versions-Enterprise-migrations with OCA modules. So we do a variety of things:
a) sometimes we deinstall the OCA module and install it back again
b) sometimes we just browse through the previous-version migration scripts of the OCA modules, and chuck excerpts of them in a custom post-migration script
c) sometimes we opt for openupgrade instead, for the reasons
Pedro mentioned
d) we also tried to make a framework to go version-by-version and run each enterprise migration version by version, then downloading the db again, running OCA migrations, reuploading etc. But this is very slow, and also Odoo does not allow unsupported versions as a target version, so also not a silver bullet
I'm leaning towards Pedro on this one, because in the case that Stefan describes "for projects where there isn't that much in-depth knowledge (...) on odoo.sh" while we assume that we could help these poor consultants with less knowledge by having the migration script there, it could also well be that:
- we actually introduce new errors for them
- they opt for the hack and slash method anyway eg deinstall and install again
- they edit the module in-place for the time being and copypaste some parts of the older migration script
- they live with the incorrect datamigration, or they fix it in a manual way by exporting/reimporting data from a spreadsheet
- they decide to hire tech-savvy guys to get the oca module and perhaps some of the other breaking things over the line
etc. So while we think we may be helping them, to me it's just an assumption, which is a pretty thin argument to make a change. If it does make things messier for tech-savvy people, then not doing it may be the best option.
-Tom
by Tom Blauwendraat - 11:26 - 6 May 2025
Reference
-
Removal of migration scripts on each new version
Hi,
the migration guide mandates the following
> Remove any possible migration script from previous version (in a nutshell, removemigrationsfolder inside the module if exists).
(https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0#tasks-to-do-in-the-migration)
However, it is not uncommon to skip versions when migrating an Odoo instance. You would go from 15.0 or 16.0 to 18.0 rather than migrating every year. When using the Odoo enterprise migration, the migration scripts between the source and the target version are supposed to be present in the target version. So the migration guideline breaks this type of migration.
I had a disagreement with Pedro Baeza about this on one PR, but I keep coming across instances of this such as https://github.com/OCA/account-invoicing/pull/1874 today so I would like to discuss this in a wider audience.
My preference would be for the guideline to change to say that it is allowed to keep some of the scripts if they are safe for inclusion in the later version (such as the script from https://github.com/OCA/account-invoicing/pull/1874, which checks if a field already exists before trying to add it).
Can I have a temperature check from the community to see how you all feel about this?
Best regards,
Stefan
-- Opener B.V. - Business solutions driven by open source collaboration Stefan Rijnhart - Consultant/developer mail: stefan@opener.amsterdam tel: +31 (0) 6 1447 8606 web: https://opener.amsterdam
by Stefan Rijnhart - 01:00 - 6 May 2025