Upgrade OpenERP 7 -> Odoo 8 using OpenUpgrade

OpenUpgrade offers users of the Community Edition an upgrade path for OpenERP/Odoo. For simple installations, the update works relatively well - but for complex installations with their own modules, the upgrade effort can quickly become very high.

The basis for the following steps is a current basic system. For this, Ubuntu 18.04. was used as described in this article: OpenERP 7 on Ubuntu server 18.04.

Check modules:

Own modules, not listed modules: Check if adjustments are necessary.

Vorbereitung

 

$ systemctl stop openerp
$ systemctl disable openerp

 

The following packages are required for the migration or later for Odoo 8.0:

 

$ apt install python-decorator python-psutil python-requests python-jinja2 python-passlib
$ pip install pypdf
$ wget github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
$ dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

 

OpenERP 7 -> Odoo 8 Upgrade

 

$ su - openerp
wget raw.githubusercontent.com/OCA/OpenUpgrade/8.0/scripts/migrate.py
python migrate.py --config=/etc/openerp/openerp-server.conf --database=[dbname] --run-migrations=8.0

 

The user, the path to the configuration file and the database name must be adjusted accordingly.

Finally, check the migration log for possible errors:

 

less /var/tmp/openupgrade/migration.log

 

Install Odoo 8.0

Since the name of the system changes, I also adapt the user:

 

$ groupadd odoo
$ useradd --system --home-dir=/opt/odoo -m -g odoo odoo

$ mkdir -p /opt/odoo
$ cd /opt/odoo
$ git clone github.com/odoo/odoo.git --branch 8.0 --single-branch
$ mv odoo/* .
$ mv odoo/.[a-z]* .
$ rmdir odoo
$ chown -R odoo:odoo /opt/odoo/
$ vim /etc/odoo/odoo-server.conf

 

[options]
addons_path = /opt/odoo/addons,/opt/odoo-custom/addons
admin_passwd = SomeStr0ngPaßword
db_host = False
db_port = False
db_user = odoo
db_password = False
;Log settings
logfile = /var/log/odoo/odoo-server.log
log_level = error

 

Afterwards I create a new systemd service:

 

$ vim /etc/systemd/system/odoo.service

 

[Unit]
Description=Advanced OpenSource ERP and CRM server
Requires=postgresql.service
After=postgresql.service
[Install]
Alias=odoo.service
[Service]
Type=simple
PermissionsStartOnly=true
EnvironmentFile=-/etc/conf.d/odoo-server
User=odoo
Group=odoo
SyslogIdentifier=odoo-server
PIDFile=/run/odoo/odoo-server.pid
ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo
ExecStart=/opt/odoo/openerp-server -c /etc/odoo/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog $OPENERP_ARGS
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=multi-user.target

 

Adjust database name and user

 

$ sudo -u postgres createuser -s odoo
$ su - openerp -c "psql"

 

ALTER DATABASE dbname_migrated OWNER TO odoo;
ALTER DATABASE dbname_migrated RENAME TO dbname_8;
# Datenbanken auflisten und prüfen ob die obigen Befehle erfolgreich waren:
\l
\q

 

Start Odoo 8.0

 

$ systemctl start odoo

 

Afterwards Odoo can be accessed via example.com and everything can be checked. Only when it is certain that all data has been transferred correctly and the work processes can be mapped as desired can the new version go live.

Sources

Oops, an error occurred! Code: 202009212242513d5d4539