Using OCA - Open Upgrade to upgrade your own modules

Customizing OCA OpenUpgrade: Step one: Analysis
November 15, 2024 by
Oliver Arnold

Customizing OCA OpenUpgrade for Your own Modules - Analysis

If you’re upgrading Odoo and want to ensure a seamless transition for your custom modules, OCA OpenUpgrade is your go-to tool. While it simplifies migrations with a robust framework, customizing it for your modules involves specific steps. This guide shows you how to analyze and upgrade a module, using tools like openupgrade_analysis.txt and openupgrade_analysis_work.txt, even help us all for scripting the upgrade for Odoo V18.

Step-by-Step Guide

1. OpenUpgrade Environment: Install and configure OpenUpgrade for the Odoo versions you are migrating between.

  • Set Up a restore of your database
    Start your Odoo instance and restore the backup of your database via the database manager:
    http://localhost:8069/web/database/manager
  • Clone the OpenUpgrade Repository
    Clone the repository and switch to the target branch:
    git clone https://github.com/OCA/OpenUpgrade.git
    cd OpenUpgrade
    git checkout <target_version_branch>
    Replace <target_version_branch> with your target Odoo version (e.g., 16.0 or 15.0).

2. Run OpenUpgrade in Analysis Mode
Use OpenUpgrade’s analysis mode to generate insights:


python3 odoo-bin -d empty_db --load=base --update=all --stop-after-init --log-level=debug_sql --config=/path/to/your/odoo.conf --openupgrade-analysis


Replace /path/to/your/odoo.conf with your Odoo configuration file path.

The --openupgrade-analysis flag triggers the generation of analysis files.

3. Locate the Analysis Files
Find the generated files in the openupgrade_scripts/scripts/<module_name> folder:

  • openupgrade_analysis.txt: Highlights changes between old and new module versions (e.g., renamed fields).
  • openupgrade_analysis_work.txt: Lists tasks and steps needed for migration.


With these steps, you can analyze and prepare your modules for a smooth Odoo upgrade.

in News