How-to

Odoo 16 to 19 Migration: A Practical On-Premise Upgrade Guide

How to move a self-hosted Odoo 16 Enterprise installation, including the database, filestore, custom modules and multi-website QWeb templates, to Odoo 19 on a new server with a tested, repeatable cutover.

Kalvyai Engineering · · Updated · 8 min read

Odoo 16 to 19 Migration: A Practical On-Premise Upgrade Guide (cover)
On this page

This guide covers moving a self-hosted Odoo 16 Enterprise installation to Odoo 19 Enterprise on a new server. It assumes PostgreSQL, a filestore on disk, custom modules, and one or more websites with customised QWeb templates. Notes for Community edition users are included where the path differs.

The short version: build a clean Odoo 19 server, upgrade a copy of your real database through Odoo's upgrade service, port your custom code in parallel, test on the upgraded copy, rehearse the cutover, then repeat it for production.

Fresh install or in-place upgrade?

"Clean install" should mean a clean server and codebase, not a clean database.

  • Clean server: yes. New OS, new Python environment, new Odoo 19 source, new PostgreSQL version if needed. The old server stays untouched as your fallback.
  • Empty database plus data import: usually no. Re-importing records through CSV or scripts loses history, chatter, accounting links, reconciliations, stock moves and sequences. It is only worth considering if you want to restart with opening balances and accept losing history.
  • Upgraded copy of your existing database: yes. This keeps every record and relation. You remove legacy clutter before the upgrade (see the cleanup step), not by throwing the data away.

You do not need to install Odoo 17 and 18 yourself. The official upgrade service handles the intermediate versions internally and returns a database for your target version.

Step 1: Inventory what you have

Before touching anything, list what has to survive the move. Run these on a copy of the Odoo 16 database.

SQL
-- Installed modules, with author to spot custom and third-party ones
SELECT name, latest_version, author
FROM ir_module_module
WHERE state = 'installed'
ORDER BY author, name;

-- Website-specific views (usually created by editing in the website builder)
SELECT id, key, name, website_id, write_date
FROM ir_ui_view
WHERE website_id IS NOT NULL
ORDER BY website_id, key;

-- Views that do not come from any module file (created or copied in the database)
SELECT v.id, v.key, v.name, v.website_id
FROM ir_ui_view v
LEFT JOIN ir_model_data d ON d.model = 'ir.ui.view' AND d.res_id = v.id
WHERE d.id IS NULL;

-- Where attachments are stored
SELECT count(*) FILTER (WHERE store_fname IS NOT NULL) AS in_filestore,
       count(*) FILTER (WHERE db_datas IS NOT NULL)    AS in_database
FROM ir_attachment;

Sort your modules into four groups:

  1. Standard Odoo modules. Handled by the upgrade service.
  2. Third-party modules from the Odoo Apps store or OCA. Check whether the vendor publishes a 19.0 version.
  3. Your own custom modules. You must port these.
  4. Database-only customisations: website builder edits, Studio changes, automated actions, server actions. These travel with the database but may break or be disabled during the upgrade.

Step 2: Clean up in Odoo 16 first

Everything you remove now is something you do not have to port, test or debug later.

  1. Uninstall modules nobody uses. Do this on a test copy first and check what else gets removed with them.
  2. Archive or delete unused websites, pages, menus and draft templates.
  3. Remove website builder edits that duplicate what a custom module already does. Two layers of customisation on the same template is a common source of upgrade failures.
  4. Delete old automated actions and server actions that no longer run.
  5. Fix data errors you already know about (duplicate partners, broken stock, unreconciled test entries). The upgrade will not fix them and may fail on them.

Step 3: Build the Odoo 19 server

Set up the new machine as if it were production from day one.

  • Python and PostgreSQL versions: use the versions supported by Odoo 19.
  • Code layout: keep Odoo source, the Enterprise addons, third-party addons and your own addons in separate directories, all under version control.
  • Data directory: set data_dir explicitly so you always know where the filestore lives.
  • Reverse proxy: route every website subdomain to Odoo, forward /websocket to the gevent port, and enable proxy_mode.

A starting configuration:

INI / config
[options]
addons_path = /opt/odoo/odoo/addons,/opt/odoo/enterprise,/opt/odoo/third_party,/opt/odoo/custom
data_dir = /var/lib/odoo
db_host = localhost
db_user = odoo
dbfilter = ^prod19$
proxy_mode = True
workers = 5  # common starting point: (2 x CPU cores) + 1, then check RAM
gevent_port = 8072
list_db = False

With several websites on one database, use a dbfilter that always resolves to that one database (as above), not one based on the hostname. Each website's domain is then set on the website record itself.

Step 4: Request a test upgrade of the database

Enterprise: use the official upgrade service

For Enterprise with an active subscription, Odoo's upgrade service is the standard route. It upgrades the data of all standard Odoo modules. It does not port your custom module code.

For self-hosted databases, Odoo provides a script that dumps the database, sends it to the service and fetches the upgraded result. Run it on a server that can reach your Odoo 16 database:

Bash
python3 <(curl -s https://upgrade.odoo.com/upgrade) test -d prod16 -t 19.0

Check the official upgrade documentation for the full list of options, how the filestore is handled by the script, and how the upgraded test database is restored.

If the test upgrade fails on standard data, open a ticket with Odoo support through the upgrade platform. Keep the logs; they list views that were disabled or reset during the upgrade.

Community: OpenUpgrade

Community users cannot use the official service for Community-only databases in the same way. The usual alternative is OpenUpgrade from the OCA. It migrates one major version at a time, so 16 to 19 means three runs (16→17, 17→18, 18→19), each with that version's code. Module coverage varies per version; check the coverage list for 17.0, 18.0 and 19.0 before committing. OpenUpgrade does not cover Enterprise modules.

Step 5: Move and verify the filestore

The database only stores a path (store_fname) for each attachment. The actual files live in <data_dir>/filestore/<database_name>/. If the files are missing, images, PDFs and documents show as broken even though the records exist.

  1. Copy the Odoo 16 filestore to the new server.
  2. Rename the target folder to match the new database name.
  3. Make sure the Odoo system user owns it.
Bash
rsync -a --info=progress2 \
  old-server:/var/lib/odoo/filestore/prod16/ \
  /var/lib/odoo/filestore/prod19/
chown -R odoo:odoo /var/lib/odoo/filestore/prod19

Adjust the source path to your Odoo 16 data_dir (the default is under the Odoo user's home directory if data_dir was never set).

Then check for missing files from an Odoo shell on the upgraded database (odoo-bin shell -c /etc/odoo.conf -d prod19):

Python
import os

Att = env['ir.attachment']
env.cr.execute("SELECT id, store_fname FROM ir_attachment WHERE store_fname IS NOT NULL")
missing = [att_id for att_id, fname in env.cr.fetchall()
           if not os.path.exists(Att._full_path(fname))]
print(len(missing), 'attachments missing on disk')
print(missing[:50])

A small number of missing files may already have been missing in Odoo 16; run the same check there to compare. Do the final rsync during cutover so files uploaded after your first copy are included.

Step 6: Port custom modules and templates

How compatible is Odoo 16 code with Odoo 19?

Expect real work. Three major versions apart, most custom modules need changes to Python, XML views and JavaScript. Some examples you will almost certainly hit:

  • Odoo 17 removed attrs and states in views. Conditions move into invisible, readonly and required attributes as Python-like expressions.
  • Odoo 17 replaced name_get with computing display_name.
  • Odoo 18 renamed the tree view type to list, in both view arch and view_mode.
  • Odoo 19 brings further ORM and frontend changes.

A typical view change from 16 to 17+:

Diff
-<field name="discount_reason" attrs="{'invisible': [('discount', '=', 0)]}"/>
+<field name="discount_reason" invisible="discount == 0"/>

Website QWeb templates

Custom website templates break more often than backend views because the standard templates they inherit are restructured between versions. An XPath that pointed at a specific div in Odoo 16 may not find it in 19, and the view fails to load.

  • Templates in your modules: re-check every xpath against the Odoo 19 version of the parent template. Rewrite inherited templates rather than patching them line by line if the parent changed a lot.
  • Edits made in the website builder: these are stored as website-specific copies of views (the website_id list from Step 1). If they no longer validate, the upgrade can disable or reset them. Compare the Step 1 list with the upgrade log, then rebuild lost edits in the Odoo 19 editor or move them into a module.
  • Snippets and frontend JavaScript: custom snippets and widgets usually need rewriting for the Odoo 19 frontend.

Migration scripts for data changes

If you rename fields or models in a custom module, ship migration scripts so existing data follows. Place them in migrations/<module_version>/ inside the module, matching the new version in __manifest__.py:

Python
# custom_sale/migrations/19.0.1.0.0/pre-migrate.py
from odoo.upgrade import util

def migrate(cr, version):
    util.rename_field(cr, 'sale.order', 'x_old_ref', 'customer_reference_code')

odoo.upgrade.util comes from Odoo's open-source upgrade-util library, which must be installed on the server. After restoring the upgraded database, update your custom modules:

Bash
./odoo-bin -c /etc/odoo.conf -d prod19 -u custom_sale,custom_website --stop-after-init

Tools that help find incompatible code

  • odoo-module-migrator (OCA): automates many mechanical changes between versions.
  • pylint-odoo (OCA): flags deprecated patterns and common mistakes.
  • The Odoo server log: start Odoo 19 with your modules and read every warning and traceback.
  • Upgrade Autopilot: our Upgrade Autopilot app moves custom Odoo apps to the next version, automatically upgraded and tested, which takes much of the repetitive porting off your developers.

None of these replace a developer reviewing business logic and testing the result.

Step 7: Test on the upgraded copy

Before anyone touches the test database, neutralise it so it cannot send email, run payments or call external services:

Bash
./odoo-bin neutralize -c /etc/odoo.conf -d prod19_test

Then test in this order:

  1. Server starts cleanly with all modules and no tracebacks in the log.
  2. Data checks: compare counts and totals between 16 and 19 (partners, products, open invoices, trial balance, stock valuation).
  3. Key workflows by the people who do them daily: quote to invoice, purchase to bill, stock transfers, manufacturing, payroll, whatever applies.
  4. Every website and subdomain: home page, menus, product pages, checkout, forms, login, portal, translations, SEO fields.
  5. Reports and documents: invoices, delivery slips, custom PDF layouts.
  6. Integrations: payment providers, shipping, email servers, APIs. Point them at sandbox accounts.

Keep a written list of issues. Fix them in code or in a repeatable script, never by hand on the test database only, or you will have to repeat the manual fix at cutover.

Step 8: Rehearse, then cut over

Do at least one full rehearsal with a fresh production copy. Time each step; that timing becomes your downtime window.

Cutover checklist:

  1. Announce the freeze window to users and customers.
  2. Stop Odoo 16 (or switch websites to a maintenance page) so no new data comes in.
  3. Take a final database dump and filestore copy of Odoo 16. Keep them as your rollback point.
  4. Request the production upgrade (production instead of test in the upgrade script).
  5. Restore the upgraded database on the new server, run the final filestore rsync, update custom modules.
  6. Do not neutralise this database. Re-check outgoing mail, payment providers and scheduled actions.
  7. Run a short smoke test of the critical workflows and every website.
  8. Switch DNS or the reverse proxy to the Odoo 19 server.
  9. Watch logs and user reports closely for the first days. Keep the Odoo 16 server available read-only until you are confident.

Update the Enterprise subscription details for the new database if Odoo asks for it.

Common problems and lessons

  • Underestimating website work. Backend modules are often easier than heavily customised websites. Budget the most time for templates and snippets.
  • Porting code before the test upgrade. Get the upgraded test database first, then port against real data.
  • Fixes that only exist on the test server. Every fix must be in code, a script or a written step.
  • Forgetting the filestore. Always verify files after restore, not just the database.
  • One-shot cutover. A rehearsal finds the problems you would otherwise meet at midnight on go-live day.

How Kalvyai can help

Kalvyai implements and customises Odoo, including version upgrades of self-hosted Enterprise and Community installations with custom modules and multi-website setups. We can inventory your system, port custom code and QWeb templates, run the test upgrades and handle the cutover with you. Contact us to plan your migration.

Share this article

Last updated 28 Nov 2026

  • Odoo
  • Odoo 19
  • Odoo Migration
  • Odoo Upgrade
  • On-Premise
  • Odoo Website
  • QWeb

Kalvyai Engineering · Engineering team

The engineers who build, connect and fix business systems at Kalvyai: Odoo, ERPNext, Shopify and AI agents that work inside them with approvals, budgets and an audit trail.

Comments

No comments yet. Questions and corrections are welcome.

Rate this post or leave a comment

Your rating (optional)
Not rated

Comments appear after an editor approves them. See our privacy notice.

Read next

WhatsApp Coexistence for Odoo 19: Setup and User Guide (cover)User guide
Kalvyai EngineeringOdoo

WhatsApp Coexistence for Odoo 19: Setup and User Guide

How to install, connect and use WhatsApp Coexistence for Odoo 19 so your team keeps replying from the WhatsApp Business app while Odoo logs every message on the same number.

7 min read

Newsletter

Get new guides in your inbox.

Practical notes on Odoo, ERPNext, Shopify and AI agents, written by the engineers who build them. No spam, and you can ask to stop at any time.

Prefer a feed? Subscribe by RSS. We use your email only to send new articles. See our privacy policy.