# Upgrading Odoo Community - Step by Step Guide Upgrading Odoo Community to a new version involves several steps to ensure a successful and smooth transition. Follow this comprehensive guide to upgrade your Odoo instance from version 14 to version 16 using the OpenUpgrade tool. ## 1. Prepare the Environment Before you begin, make sure you have Python and pip installed on your system. * ### Install OpenUpgrade Library: Open a terminal and run the following command to install the OpenUpgrade library: ``` pip install --ignore-installed git+https://github.com/OCA/openupgradelib.git@master ``` * ### Check OpenUpgrade Coverage: Determine which modules are covered by OpenUpgrade for automatic migration. Check the list of covered modules on the [OpenUpgrade status](https://oca.github.io/OpenUpgrade/status.html) page. * ### Module Patching (if needed): If any of your modules are not covered by OpenUpgrade, search for related scripts in the [OpenUpgrade pull requests](https://github.com/OCA/OpenUpgrade/pulls). Apply these scripts manually to the openupgrade_scripts directory. find and copy relevant scripts from OpenUpgrade/openupgrade_scripts/scripts/<targeted module> to the same directory in your instances. ## 2. Set Up Odoo Instances To upgrade from version 14 to 16, you need instances of Odoo for each version: * ### Clone Odoo Repositories: Clone the Odoo repository for version 16 from the official repository: ``` git clone https://github.com/odoo/odoo.git cd odoo ``` * ### Create Instances for Versions 14 and 15: Duplicate the directory for version 16 and checkout the appropriate branches: ``` cp -r odoo odoo14 cd odoo14 git checkout 14.0 cd ../odoo cp -r odoo odoo15 cd odoo15 git checkout 15.0 cd .. ``` * ### Clone OpenUpgrade Repository: Inside the directories of versions 15 and 16, clone the OpenUpgrade repository: ``` git clone https://github.com/OCA/OpenUpgrade.git ``` * ### Set Up Compatible OpenUpgrade Version: Inside each OpenUpgrade directory, switch to a compatible version: ``` cd OpenUpgrade git checkout <compatible_version> cd .. ``` ## 3. Modify Odoo Configuration Files For each version's configuration file (e.g., odoo15.conf), add the following lines to include OpenUpgrade and set the target version: ``` addons_path = /path/to/odoo15/addons,/path/to/odoo15/OpenUpgrade upgrade_path = /path/to/odoo15/OpenUpgrade/openupgrade_scripts/scripts server_wide_modules = web,openupgrade_framework ``` Set the target version using an environment variable: ``` export OPENUPGRADE_TARGET_VERSION=16.0 ``` ## 4. Additional Configuration and Steps Before starting the upgrade process, take these additional steps: * ### Uninstall Custom Modules: In the version 14 instance, uninstall all custom modules that might cause conflicts during the upgrade process. * ### Initiate Upgrade Process: In the version 15 directory, run the following command to initiate the upgrade process: ``` python3 odoo-bin -c odoo15.conf --database=<database_to_upgrade> --update all --stop-after-init ``` Now that the database has been successfully upgraded to version 15, let us proceed with the identical steps to further elevate it to version 16. * ### Complete the Upgrade: Once the upgrade process for version 15 is completed, run the following command in the version 16 directory to finalize the upgrade: ``` python3 odoo-bin -c odoo16.conf --database=<database_to_upgrade> --update all --stop-after-init ``` ## 5. Post-Upgrade Steps * ### Start Odoo 16: Inside the odoo16 directory run the following ``` python3 odoo-bin -c odoo16.conf ``` Now, proceed to upgrade the custom modules either from the Odoo Apps Store. If you have developed these modules yourself, it's advisable to meticulously review any alterations between the versions and make any necessary modifications. After this evaluation, install the cm module to ensure its compatibility and optimal functionality within the upgraded Odoo instance, and don't forget to add the custom modules path to the odoo 16 config file 'addons'.