Free • No Commitment

Know What You're
Getting Into

Get a data-backed look at the work need for your Odoo migration. Run our open-source odoo-db tool, send us the resulting file, and we'll come back with a free assessment — no strings attached.

Why audit first

A migration without an audit is a quote without a brief.

Migrating Odoo isn't just a technical version bump — it's a chance to rationalise modules, retire orphan tables, and surface the long-tail of customisations that nobody remembers but everyone depends on.

Read our blog: why pre-migration audits matter

Real scope, not guesswork

The audit will give you some concrete numbers: installed modules, custom code, table sizes, orphan data, active users. This will help to make the estimation more accurate.

Surface the hidden surface

Custom views, triggers, stored procedures. The audit lists every non-Odoo object in your database, so nothing surprises you mid-migration.

Build a data-driven plan

Knowing your data shape lets us recommend the right migration approach — one-shot vs incremental, full vs partial scope, Odoo Upgrade platform vs OpenUpgrade or custom path...

How it works

Run odoo-db, send the JSON, get your audit.

Four steps. Anyone with shell access to your Odoo host can complete them in a few minutes.

1

Install odoo-db

You probably have a host with a copy of your production database. Refresh it first. Then install odoo-db. The tool is fully open source, see https://trobz.github.io/odoo-db

uv tool install git+https://github.com/trobz/odoo-db

Please consult the documentation for more details about the installation: https://trobz.github.io/odoo-db.

2

List your databases

Confirm odoo-db can connect to PostgreSQL via Unix socket (peer auth — no password needed) and see your Odoo databases.

odoo-db list
3

Generate the audit bundle

Run prepare-audit against the database you want assessed. The tool writes <your_db_name>.json in the current directory — that's the file we need.

odoo-db prepare-audit <your_db_name>

The JSON file contains module list and dependencies, table sizes, custom views/triggers/functions, orphan tables and yearly user counts. No row-level data, no personal or sensitive information.

Show every SQL query the tool runs
prepare-audit only runs read-only SELECT queries: nothing is written to your database. Here is the full list, taken from the odoo-db source code.
-- Every query `odoo-db prepare-audit <db>` runs, in order.
-- All of them are read-only SELECTs: nothing is written to your database.
-- Placeholders such as :years, :tables or <table> are filled in by the tool.

-- ─────────────────────────────────────────────────────────────
-- 1. Database summary
-- ─────────────────────────────────────────────────────────────

-- Is this an Odoo database?
SELECT 1 FROM pg_tables WHERE tablename = 'ir_module_module';

-- Odoo version, read from the "base" module
SELECT latest_version FROM ir_module_module WHERE name = 'base';

-- Database flags (neutralized, anonymized, shrunk...). Only these exact
-- keys are read: never database.secret or any other parameter.
SELECT key, value
FROM ir_config_parameter
WHERE key = ANY(ARRAY[
  'database.is_neutralized', 'database.is_configured_for_safe_testing',
  'database.is_shrunk', 'database.is_anonymized', 'database.is_obfuscated',
  'database.source_dump_datetime'
]);

-- Installed module count and active user count
SELECT count(*) FROM ir_module_module WHERE state = 'installed';
SELECT count(*) FROM res_users WHERE active = true;

-- ─────────────────────────────────────────────────────────────
-- 2. Modules
-- ─────────────────────────────────────────────────────────────

-- Installed modules with their version
SELECT name, latest_version, auto_install, state
FROM ir_module_module
WHERE state = 'installed'
ORDER BY name;

-- What each installed module depends on (the dependency graph,
-- used to order the migration; dependent counts are derived from it)
SELECT m.name, d.name
FROM ir_module_module_dependency d
JOIN ir_module_module m ON m.id = d.module_id
WHERE m.state = 'installed'
ORDER BY 1, 2;

-- Who wrote each installed module (tells Odoo, OCA and custom modules apart)
SELECT name, author, website
FROM ir_module_module
WHERE state = 'installed';

-- Which module declared each model (= owns each table)
SELECT DISTINCT ON (im.id)
  replace(im.model, '.', '_') AS tablename,
  imd.module
FROM ir_model im
JOIN ir_model_data imd ON imd.model = 'ir.model' AND imd.res_id = im.id
ORDER BY im.id, imd.id;

-- Which module declared each many2many relation table
SELECT DISTINCT ON (r.name) r.name, m.name
FROM ir_model_relation r
JOIN ir_module_module m ON r.module = m.id
ORDER BY r.name, r.id;

-- ─────────────────────────────────────────────────────────────
-- 3. Table volumes and sizes
-- ─────────────────────────────────────────────────────────────

-- All Odoo tables (any table with a create_date column)
SELECT c.relname
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
JOIN pg_attribute a ON a.attrelid = c.oid
WHERE n.nspname = 'public' AND a.attname = 'create_date' AND c.relkind = 'r'
ORDER BY c.relname;

-- Table name -> model name
SELECT replace(model, '.', '_') AS tbl, model FROM ir_model;

-- Size on disk of each table
SELECT relname,
  pg_total_relation_size(relid) AS total_bytes,
  pg_relation_size(relid) AS table_bytes
FROM pg_statio_user_tables
WHERE relname = ANY(:tables)
ORDER BY total_bytes DESC;

SELECT EXTRACT(year FROM NOW())::int;

-- For each non-empty table: records created per year (last :years years,
-- 3 by default) and total record count. Counts only, no row content.
SELECT EXTRACT(year FROM create_date)::int AS yr, count(*)
FROM <table>
WHERE create_date >= NOW() - make_interval(years => :years)
GROUP BY yr;

SELECT count(*) FROM <table>;

-- Index size per table
SELECT i.relname AS table_name, sum(pg_relation_size(i.indexrelid)) AS index_bytes
FROM pg_stat_all_indexes i
JOIN pg_class c ON i.relid = c.oid
WHERE i.schemaname NOT IN ('information_schema', 'pg_catalog', 'pg_toast', 'pg_logical')
  AND i.relname = ANY(:tables)
GROUP BY i.relname;

-- Attachment volume per model (duplicates counted once, by checksum)
WITH unique_attachments AS (
  SELECT res_model, file_size,
    row_number() OVER (PARTITION BY checksum ORDER BY id) AS rowno
  FROM ir_attachment
)
SELECT res_model, sum(file_size)
FROM unique_attachments
WHERE rowno = 1
GROUP BY res_model;

-- Total database size
SELECT pg_size_pretty(pg_database_size(current_database()));

-- ─────────────────────────────────────────────────────────────
-- 4. Objects created outside Odoo (they must be ported by hand)
-- ─────────────────────────────────────────────────────────────

-- SQL views not backed by an Odoo model
SELECT viewname
FROM pg_views
WHERE schemaname = 'public'
  AND viewname NOT IN (SELECT replace(model, '.', '_') FROM ir_model)
ORDER BY viewname;

-- Triggers (Odoo itself never creates any)
SELECT trigger_name, event_object_table,
  string_agg(DISTINCT event_manipulation, '/' ORDER BY event_manipulation) AS events,
  action_timing
FROM information_schema.triggers
WHERE trigger_schema = 'public'
GROUP BY trigger_name, event_object_table, action_timing
ORDER BY event_object_table, trigger_name;

-- Custom functions and procedures (names only, extensions excluded)
SELECT DISTINCT p.proname, p.prokind
FROM pg_proc p
JOIN pg_namespace n ON p.pronamespace = n.oid
LEFT JOIN pg_depend d ON d.objid = p.oid AND d.deptype = 'e'
LEFT JOIN pg_extension e ON e.oid = d.refobjid
WHERE n.nspname = 'public'
  AND e.extname IS NULL
  AND p.prokind IN ('f', 'p')
ORDER BY p.proname;

-- ─────────────────────────────────────────────────────────────
-- 5. Users: aggregate counts only (no login, name or email)
-- ─────────────────────────────────────────────────────────────

-- Active users per creation year
SELECT EXTRACT(year FROM create_date)::int AS yr, count(*)
FROM res_users
WHERE active = true AND create_date IS NOT NULL
GROUP BY yr
ORDER BY yr;

-- Active users per month of last login, plus those who never logged in
SELECT to_regclass('public.res_users_log');

WITH last AS (
  SELECT create_uid AS uid, MAX(create_date) AS last_login
  FROM res_users_log GROUP BY create_uid
)
SELECT to_char(last.last_login, 'YYYY-MM') AS ym, count(*)
FROM res_users ru
JOIN last ON last.uid = ru.id
WHERE ru.active = true
GROUP BY ym
ORDER BY ym;

SELECT count(*) FROM res_users ru
WHERE ru.active = true
  AND NOT EXISTS (SELECT 1 FROM res_users_log l WHERE l.create_uid = ru.id);

-- (Odoo 8.0 has no res_users_log: the same counts come from res_users.login_date)
SELECT to_char(login_date, 'YYYY-MM') AS ym, count(*)
FROM res_users
WHERE active = true AND login_date IS NOT NULL
GROUP BY ym
ORDER BY ym;

SELECT count(*) FROM res_users WHERE active = true AND login_date IS NULL;

-- ─────────────────────────────────────────────────────────────
-- 6. Studio and manual customizations
-- ─────────────────────────────────────────────────────────────

-- Is Odoo Studio installed? (ir_model_data.studio column exists)
SELECT column_name FROM information_schema.columns
WHERE table_name = 'ir_model_data' AND column_name = 'studio';

-- Custom models (x_...) and their custom field count
SELECT m.model, m.name,
  count(f.id) FILTER (WHERE f.state = 'manual') AS custom_fields
FROM ir_model m
LEFT JOIN ir_model_fields f ON f.model_id = m.id
WHERE m.state = 'manual'
GROUP BY m.model, m.name
ORDER BY m.model;

-- Mixins inherited by custom models (mail.thread, ...)
SELECT DISTINCT child.model, parent.model AS mixin
FROM ir_model_inherit inh
JOIN ir_model child ON inh.model_id = child.id
JOIN ir_model parent ON inh.parent_id = parent.id
WHERE child.state = 'manual'
ORDER BY child.model, parent.model;

-- Studio only: list every record Studio created...
SELECT model, res_id, module || '.' || name AS xmlid
FROM ir_model_data
WHERE studio = true
ORDER BY model, id;

-- ...then describe them, one query per record type.
-- :ids are the Studio-created record ids from the query above.
SELECT f.id, f.name, f.ttype, f.field_description, m.model           -- fields
FROM ir_model_fields f JOIN ir_model m ON f.model_id = m.id
WHERE f.id = ANY(:ids) ORDER BY m.model, f.name;

SELECT v.id, v.name, v.model, v.type, v.mode                         -- views
FROM ir_ui_view v
WHERE v.id = ANY(:ids) ORDER BY v.model, v.name;

SELECT a.id, a.name, a.res_model, bm.model AS binding_model          -- window actions
FROM ir_act_window a LEFT JOIN ir_model bm ON a.binding_model_id = bm.id
WHERE a.id = ANY(:ids) ORDER BY a.res_model, a.name;

SELECT ias.id, ias.name, bm.model AS bound_to, ias.state             -- server actions
FROM ir_act_server ias LEFT JOIN ir_model bm ON ias.binding_model_id = bm.id
WHERE ias.id = ANY(:ids) ORDER BY bm.model, ias.name;

SELECT m.id, m.model, m.name                                         -- models
FROM ir_model m
WHERE m.id = ANY(:ids) ORDER BY m.model;

SELECT id, name, parent_id FROM ir_ui_menu;                          -- menus (full menu tree,
SELECT id, name FROM ir_ui_menu WHERE id = ANY(:ids) ORDER BY id;    -- to build menu paths)

SELECT acc.id, acc.name, m.model, g.name AS group_name,              -- access rights
  acc.perm_read, acc.perm_write, acc.perm_create, acc.perm_unlink
FROM ir_model_access acc
JOIN ir_model m ON acc.model_id = m.id
LEFT JOIN res_groups g ON acc.group_id = g.id
WHERE acc.id = ANY(:ids) ORDER BY m.model, acc.name;

SELECT 1 FROM pg_tables WHERE tablename = 'ir_model_inherit';        -- model inheritance
SELECT inh.id, child.model AS child_model, parent.model AS inherits_from
FROM ir_model_inherit inh
JOIN ir_model child ON inh.model_id = child.id
JOIN ir_model parent ON inh.parent_id = parent.id
WHERE inh.id = ANY(:ids) ORDER BY child.model;

SELECT d.id, m.model, f.name AS field_name, d.json_value             -- default values
FROM ir_default d
JOIN ir_model_fields f ON d.field_id = f.id
JOIN ir_model m ON f.model_id = m.id
WHERE d.id = ANY(:ids) ORDER BY m.model, f.name;

SELECT ba.id, ba.name, m.model AS on_model, ba.trigger               -- automation rules
FROM base_automation ba JOIN ir_model m ON ba.model_id = m.id
WHERE ba.id = ANY(:ids) ORDER BY m.model, ba.name;

SELECT r.id, r.name, m.model AS on_model                             -- record rules
FROM ir_rule r JOIN ir_model m ON r.model_id = m.id
WHERE r.id = ANY(:ids) ORDER BY m.model, r.name;

SELECT mod.id, mod.name, mod.state                                   -- modules
FROM ir_module_module mod
WHERE mod.id = ANY(:ids) ORDER BY mod.name;

-- Custom fields added to standard models
-- (has_studio_tracking is a constant false when Studio is not installed)
SELECT m.model, f.name, f.ttype, f.field_description,
  f.relation, f.required, f.readonly, f.store,
  EXISTS (
    SELECT 1 FROM ir_model_data imd
    WHERE imd.model = 'ir.model.fields' AND imd.res_id = f.id AND imd.studio = true
  ) AS has_studio_tracking
FROM ir_model_fields f
JOIN ir_model m ON f.model_id = m.id
WHERE f.state = 'manual' AND m.state != 'manual'
ORDER BY m.model, f.name;

-- ─────────────────────────────────────────────────────────────
-- 7. Leftovers: columns no installed module declares
-- ─────────────────────────────────────────────────────────────

WITH model_cols AS (
  SELECT replace(m.model, '.', '_') AS tbl, f.name AS col
  FROM ir_model_fields f
  JOIN ir_model m ON m.id = f.model_id
  WHERE f.ttype NOT IN ('one2many', 'many2many')
),
odoo_tables AS (
  SELECT replace(model, '.', '_') AS tbl FROM ir_model
)
SELECT c.table_name, c.column_name, c.data_type
FROM information_schema.columns c
JOIN odoo_tables ot ON ot.tbl = c.table_name
LEFT JOIN model_cols mc ON mc.tbl = c.table_name AND mc.col = c.column_name
WHERE c.table_schema = 'public'
  AND mc.col IS NULL
  AND c.column_name NOT IN ('id', 'create_uid', 'create_date', 'write_uid', 'write_date')
ORDER BY c.table_name, c.column_name;

-- ─────────────────────────────────────────────────────────────
-- 8. Standard records edited by hand (views, actions, rules...)
-- ─────────────────────────────────────────────────────────────

-- Models that have records shipped by a module
SELECT DISTINCT model
FROM ir_model_data imd
WHERE module NOT IN ('__export__', '__import__', '__custom__', '__base__')
  AND module NOT LIKE '%studio%'
  AND EXISTS (SELECT 1 FROM ir_module_module m WHERE m.name = imd.module)
ORDER BY model;

-- Keep the ones whose table has a write_uid column
SELECT c.table_name
FROM information_schema.columns c
WHERE c.table_schema = 'public'
  AND c.column_name = 'write_uid'
  AND c.table_name = ANY(:tables);

-- Only with --admin-user <login>: turn the logins to skip into user ids
SELECT login, id FROM res_users WHERE login = ANY(:excluded_logins) ORDER BY id;

-- For each of those models: module records last modified by a user other
-- than the system user. Only the XML ID and the editor's user id are read.
-- (--admin-user adds: AND t.write_uid != ALL(:excluded_user_ids))
-- (--include-sensitive-information also reads the editor's login, through
--  LEFT JOIN res_users u ON u.id = t.write_uid)
SELECT imd.module, imd.name, t.write_uid, imd.noupdate
FROM ir_model_data imd
JOIN <table> t ON t.id = imd.res_id
WHERE imd.model = :model
  AND imd.module NOT IN ('__export__', '__import__', '__custom__', '__base__')
  AND imd.module NOT LIKE '%studio%'
  AND EXISTS (SELECT 1 FROM ir_module_module mm WHERE mm.name = imd.module)
  AND t.write_uid IS NOT NULL
  AND t.write_uid != 1
ORDER BY imd.module, imd.name;

-- ─────────────────────────────────────────────────────────────
-- 9. Messages, attachments, scheduled actions, companies
-- ─────────────────────────────────────────────────────────────

-- Chatter messages per type (count only, no content)
SELECT to_regclass('public.mail_message');
SELECT message_type, count(*)::int
FROM mail_message
GROUP BY message_type
ORDER BY count(*) DESC;

-- Attachments stored in the database vs. in the filestore
SELECT to_regclass('public.ir_attachment');
SELECT
  CASE WHEN store_fname IS NULL THEN 'db_binary' ELSE 'filestore' END AS storage,
  count(*)::int AS cnt,
  coalesce(sum(file_size), 0)::bigint AS total_size
FROM ir_attachment
GROUP BY 1;

-- Scheduled actions: name, active, Python-code based, shipped by a module
SELECT to_regclass('public.ir_cron');
SELECT s.name AS name,
  c.active,
  coalesce(s.state = 'code', false) AS code_based,
  EXISTS (
    SELECT 1 FROM ir_model_data imd
    WHERE imd.model = 'ir.cron' AND imd.res_id = c.id
  ) AS has_xmlid
FROM ir_cron c
LEFT JOIN ir_act_server s ON s.id = c.ir_actions_server_id
ORDER BY c.active DESC, s.name;

-- Number of companies
SELECT count(*) FROM res_company;
4

Upload it below

Send us the .json file together with your contact details. We'll get back to you with a written assessment within a few business days.

Go to the upload form
Submit

Request your free audit

Attach the JSON file produced by odoo-db prepare-audit and we'll take it from there.

The file generated by odoo-db prepare-audit <db>. Max 25 MB.

100% free

We do the audit. You decide what's next.

Trobz will analyse the report from your database and send you a structured assessment — usage patterns, migration complexity, risks and recommendations. There is no obligation to engage us afterwards.

Free of charge

We invest the analysis time. You get a written report you can share with your team, your board, or any other Odoo partner.

No commitment

Use the findings to plan internally, get competing quotes, or do nothing. Either way the report is yours.

Local-first data

odoo-db runs locally against your PostgreSQL instance — we never touch your live database. The JSON report you upload aggregates structure and counts, not row-level data.