Migration Odoo 15CE vers 17EE

Préparation

Mettre à jour le système:

apt update apt dist-upgrade # Installation des paquets nécessaires apt-get install libxml2-dev libxslt1-dev libsasl2-dev libldap2-dev \ libssl-dev libffi-dev libjpeg-dev libpq-dev rsync python3-geoip2 python3-rjsmin

Retirer le repository d'Odoo dans les sources APT

Migrer vers bookworm:

sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list apt update apt dist-upgrade

Passage de la version 15 CE à la version 15EE

Télécharger la version 15EE sur la page de téléchargement d'Odoo.

service odoo stop dpkg -i <path_to_enterprise_deb> su postgres -s /bin/bash cd /tmp python3 /usr/bin/odoo -d <database_name> -i web_enterprise --stop-after-init

Migration de la version 15EE à la 17EE

Supprimer les modules custom (supprimer le répertoire, désinstaller et supprimer de la liste des apps).

Couper le service Odoo

service odoo stop

Changer d'utilisateur et lancer le script de migration

su postgres -s /bin/bash cd /tmp # Migrer le format des db en UTF psql UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'; DROP DATABASE template1; CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UTF8'; UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'; \c template1; VACUUM FREEZE; # Migration de la db # Changer test par production si nécessaire python3 <(curl -s https://upgrade.odoo.com/upgrade) test -d klinicare -t 16.0 --contract xxxxxx

Mettre à jour les droits des tables (toujours avec user postgres):

psql ALTER DATABASE "klinicare_..." OWNER TO odoo; # \c "Klini # SELECT format( 'ALTER TABLE public.%I OWNER TO odoo', table_name ) FROM information_schema.tables WHERE table_schema = 'public' AND table_type = 'BASE TABLE' \gexec # drop sequence base_cache_signaling; drop sequence base_registry_signaling; drop sequence base_cache_signaling_default; drop sequence base_cache_signaling_assets; drop sequence base_cache_signaling_templates; drop sequence base_cache_signaling_routing; ALTER USER odoo WITH SUPERUSER;

Fusionner le filestore:

cp /var/lib/odoo/.local/share/Odoo/filestore/klinicare/* /var/lib/odoo/.local/share/Odoo/filestore/klinicare_test... -r #vérifier les droits sur les dossiers du filestore chown odoo:odoo /var/lib/odoo/.local/share/Odoo/filestore/* -R

Télécharger le module 17EE et le déployer

CRAP

désinstaller les modules non-officiels fermer le serveur faire un backup

su postgres -s /bin/bash service odoo stop dpkg -i python3 /usr/bin/odoo -d klinicare -i web_enterprise --stop-after-init

Lancer la commande de maj

apt install rsync su postgres -s /bin/bash cd /tmp # Changer test python3 <(curl -s https://upgrade.odoo.com/upgrade) test -d klinicare -t 16.0 --contract xxxxxx

/var/lib/odoo/.local/share/Odoo/filestore/klinicare/

klinicare_test_16.0_2024_09_02_18_10

When performing database restoration via the command line, ensure you have correctly placed the filestore. The database name and filestore name should match to ensure Odoo uses the same filestore rather than generating a new one. The filestore in Odoo is stored in /home/odoo/.local/share/Odoo/filestore (assuming /home/odoo is Odoo’s home directory).

ALTER DATABASE "klinicare_test_16.0_2024_09_02_18_10" OWNER TO odoo; # \c "klini..." SELECT format( 'ALTER TABLE public.%I OWNER TO odoo', table_name ) FROM information_schema.tables WHERE table_schema = 'public' AND table_type = 'BASE TABLE' \gexec # drop sequence base_cache_signaling; drop sequence base_registry_signaling; drop sequence base_cache_signaling_default; drop sequence base_cache_signaling_assets; drop sequence base_cache_signaling_templates; drop sequence base_cache_signaling_routing;

SELECT format(

'ALTER TABLE public.%I OWNER TO odoo',
table_name
)

FROM information_schema.tables WHERE table_schema = 'public'

AND table_type = 'BASE TABLE' \gexec

SELECT format(

'ALTER TABLE public.%I OWNER TO odoo',
table_name
)

FROM information_schema.tables WHERE table_schema = 'public'

AND table_type = 'BASE TABLE' \gexec

drop sequence base_cache_signaling; drop sequence base_registry_signaling; drop sequence base_cache_signaling_default; drop sequence base_cache_signaling_assets; drop sequence base_cache_signaling_templates; drop sequence base_cache_signaling_routing; </code>

Sources

https://www.odoo.com/documentation/15.0/fr/administration/on_premise/community_to_enterprise.html