Enable Dark Mode!
how-to-upgrade-the-odoo-database-using-openupgrade.jpg
By: Nikhil Ravi

How to Upgrade the Odoo Database Using OpenUpgrade

Technical Odoo 15

Odoo, also known as Open ERP, was created by the company in 2005. On-Demand Open Object is the acronym for Odoo. Odoo is a vast collection of business-related apps and modules, such as CRM, Sales management, E-commerce, Warehouse management, Purchase management, Accounting suite, Manufacturing suite, HRMS, and so on.

Enterprise Resource Planning software is made up of all of these essential modules. Odoo's app store contains over 14,000 third-party Apps/Plugins in addition to its core modules. They're all made to order for specific user requirements.

Odoo is now one of the most frequently utilized open-source ERP platforms available.

Before proceeding with the migration check if the OpenUpgrade source code contains the scripts for the migration of your module.

Use the below link to check the module coverage.

https://oca.github.io/OpenUpgrade/status.html

Currently, it contains the module coverage data till the migration of v14 to v15.

Running the migration

To run the migration initially fetch the code from GitHub.

https://github.com/OCA/OpenUpgrade

There will be branches for each Odoo version. Each branch migrates to its version from the previous branch. Ie, branch 14 migrates the database from version 13.0 to 14.0

To run the migration, install the latest version of the openupgradelib.

pip3 install git+https://github.com/OCA/openupgradelib.git@master#egg=openupgradelib

Adjust the configuration file:

Before Odoo 14:

To migrate in versions before 14, ie till Odoo 13 adjust the configuration as below.

Add the following parameters to the conf file.

how-to-upgrade-the-odoo-15-database-using-openupgrade-cybrosys

-c to point to the conf file to run the configuration (make sure that this file exists in the same folder in which the odoo-bin file is located)

–database points to the database which you need to migrate

–update points to the module data which needs to be migrated. If no specificity is there, add the argument as all so that all the modules will be migrated else specify the corresponding module whose data is to be migrated.

–stop-after-init to stop the configuration after everything is completed

how-to-upgrade-the-odoo-15-database-using-openupgrade-cybrosys

–addons_path should point to the addons folders within the OpenUpgrade folder of the target Odoo version. So if you are migrating from 12 to 13, the addons_path should be the addons folder in the OpenUpgrade folder of version 13(OpenUpgrade-13.0).

–db_user should be the responsible use of the database which is being migrated.

After everything is set up run the configuration and check the logs for any errors.

If everything is executed successfully, the database will be migrated to version 13.

If any error occurs which is most likely to happen do a manual clean-up of the data which is causing the issue from the database and run the migration scripts again. Repeat these steps until the database is completely migrated.

On running the Odoo 13 instance with the same db_user, you will be able to see a compatible database in 13.

how-to-upgrade-the-odoo-15-database-using-openupgrade-cybrosys

On loading this database, you’ll see all the data that existed in the 12 databases.

Typically this will be the same database that you use in 12. On running the migration, the database is made compatible with the target version. If there are any changes in the fields, views, etc they’ll be updated in the database from the scripts provided in the OpenUpgrade folders.

When you try to load the same database now in the 12 instances, it’ll be an incompatible database. So before running the migration scripts make sure that you keep a backup of the database in each version so that you don’t lose any data in any of the instances.

After Odoo 14:

From Odoo14 onwards the OpenUpgrade structure has been changed.

There will be two modules to initialize the migration running. openupgrade_framework and openupgrade_scripts. Include the folders containing these modules in the addons_path and adjust the configuration as follows.

how-to-upgrade-the-odoo-15-database-using-openupgrade-cybrosys

-c points to the corresponding conf file for the configuration. To avoid redundancies, use the odoo-bin file within the folder containing the Odoo 14 source code.

–database points to the database which needs to be migrated

–upgrade-path points to the folder containing the scripts for the migration which is contained inside the openupgrade_scripts/scripts within the OpenUpgrade main folder.

–load indicates the modules which need to be loaded initially. Load the base, web, and openupgrade_framework module within the configuration.

–update points to the modules whose data needs to be migrated.

–stop-after-init indicates the configuration to automatically stop after the implementation is completed

how-to-upgrade-the-odoo-15-database-using-openupgrade-cybrosys

 –addons_path should point to the folder which contains the main add-ons of the target version and the OpenUpgrade folder of the target versions.

If the migration is from 13 to 14, inside the addons_path it should point to the addons of 14 and the OpenUpgrade folder for 14(OpenUpgrade-14.0).

After everything is set up run the configuration and check the logs for errors.

If any error occurs which is most likely to happen do a manual clean-up of the data which is causing the issue from the database and run the migration scripts again. Repeat these steps until the database is completely migrated.

On running the 14 instances you’ll be able to see the compatible database in 14.

how-to-upgrade-the-odoo-15-database-using-openupgrade-cybrosys


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment

 
whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

London

Cybrosys Limited
Alpha House,
100 Borough High Street, London,
SE1 1LB, United Kingdom

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message