[NEW] add version 20.0 migration files

This commit is contained in:
Stéphan Sainléger
2026-09-22 18:30:56 +02:00
parent 8c732c39e2
commit c41f320003
5 changed files with 60 additions and 0 deletions

View File

@@ -102,6 +102,20 @@ ou19:
options:
workers: 0
ou20:
charm: odoo-tecnativa
docker-compose:
image: docker.0k.io/mirror/odoo:rc_20.0-ELABORE-LIGHT
## Important to keep as a list: otherwise it'll overwrite charm's arguments.
command:
- "--log-level=debug"
- "--limit-time-cpu=1000000"
- "--limit-time-real=1000000"
volumes:
- /home/stephan/dev/Odoo/0k-odoo-upgrade/versions/20.0/addons/:/opt/odoo/auto/mig:rw
options:
workers: 0
postgres:
docker-compose:
image: docker.0k.io/postgres:17.2.0-myc

View File

@@ -0,0 +1,8 @@
# Modules that became obsolete in version 20.0
obsolete: []
# Modules merged into Odoo Core in version 20.0
merged_in_core: []
# Modules renamed in version 20.0
renamed: []

7
versions/20.0/post_upgrade.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
echo "Post migration to 20.0..."
echo "Post migration to 20.0 completed!"

20
versions/20.0/pre_upgrade.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
echo "Prepare migration to 20.0..."
# Copy database
copy_database ou19 ou20 ou20 || exit 1
# Execute SQL pre-migration commands
PRE_MIGRATE_SQL=$(cat <<'EOF'
EOF
)
echo "SQL command = $PRE_MIGRATE_SQL"
query_postgres_container "$PRE_MIGRATE_SQL" ou20 || exit 1
# Copy filestores
copy_filestore ou19 ou19 ou20 ou20 || exit 1
echo "Ready for migration to 20.0!"

11
versions/20.0/upgrade.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
# --upgrade-path lists BOTH our custom migration scripts and OpenUpgrade's
# native ones. Passing --upgrade-path overrides config['upgrade_path'], and
# openupgrade_framework only sets that default when it is empty; so we must
# include the native openupgrade_scripts/scripts path explicitly, otherwise the
# native migration scripts would no longer run. Odoo appends every listed path
# to odoo.upgrade.__path__ and concatenates (does not override) the scripts
# found per module/version, so our script runs IN ADDITION to the native ones.
run_compose run -p 8020:8069 ou20 --config=/opt/odoo/auto/odoo.conf --stop-after-init -u all --workers 0 --log-level=debug --max-cron-threads=0 --limit-time-real=10000 --database=ou20 --load=base,web,openupgrade_framework --addons-path=/opt/odoo/auto/mig,/opt/odoo/auto/addons --upgrade-path=/opt/odoo/auto/upgrade,/opt/odoo/auto/addons/openupgrade_scripts/scripts