View Categories

How to upgrade Odoo to a higher major version

4 min read

Introduction #

Every year around November, Odoo releases a shiny new version with tons of new features called a “major version”. Aside from new features, a lot of improvements happen under the hood and cause significant changes in the database structure. This makes it difficult for Odoo to release a simple “Update”-button to upgrade your Odoo instance to a newer major version.

Fortunately, whether you are using Odoo Community or Odoo Enterprise, there are upgrade scripts to upgrade your database to a newer version.

This guide will focus on how to upgrade your Odoo Enterprise instance using Odoo’s Upgrade Service.

Odoo Upgrade Service vs OCA OpenUpgrade #

Odoo Upgrade Service for Enterprise users

Odoo has an Odoo Upgrade Service for Enterprise customers to upgrade your current database structure to the newer version (excluding any customizations).

OCA OpenUpgrade for Odoo Open Source users

OCA, the Odoo Community Association, is a vibrant community that releases Odoo upgrade scripts for Odoo Open Source. You can check their documentation page to see if the upgrade scripts are ready. There are also several ways to contribute to the open source project.

Requirements #

FAQ #

When is it safe to upgrade to a newer version? #

It is recommended to delay upgrading for at least 6 months following a major release. This waiting period ensures that any critical bugs are addressed through stability patches.

When is Odoo Upgrade Service ready for production? #

The Odoo upgrade scripts need to be released and ready for production, which can take up to 3-4 months after the release of a major version. The script for test databases is usually ready almost immediately after a major release. You can check the Odoo Upgrade Service website to see if the upgrade scripts are available.

Any alternative to using Upgrade Scripts? #

Upgrading your Odoo database can be a tedious process and perhaps you do not need to upgrade all your existing data to the newer Odoo version.

Instead of using a script to upgrade your database, you can simply export your Master Data: Partners (Customers and Suppliers), Products, Categories, Tax configuration, Units of Measure, Users and other static data, and import the data using the import functionality of your newer Odoo instance. Do note that in this case you won’t have all relational documents like vendor bills, purchase and sales orders, accounting entries, etc.

Step 1. Upload your database to the Odoo upgrade service #

Running the following command from your SSH console will upload your database to the Odoo upgrade service for testing:

Bash
cd /tmp
sudo -u odoo bash -c "python3 <(curl -s https://upgrade.odoo.com/upgrade) test -d <your db name> -t <target version>"

Removing the keyword “test” will request a production-ready database. You can find your db name under Odoo specifics on your Instance details in your Cloudpepper dashboard.

Odoo will send status updates to your Odoo contracts email address, but make sure to check the output from the command and save the value of the “The secret token is …” line when it appears, just in case.

Important
  • This has to be run against your production database. Staging environments contain a neutralized license key and Odoo upgrade service will not accept it.
  • Make sure you have sufficient free disk space on the server, as the original Odoo upgrade script makes a database dump locally before uploading it to their servers. You can refer to the average backup size plus a confortable margin to estimate the required free disk space.

Step 2. Restore your upgraded database as an Odoo instance #

Once you receive the download link of your upgraded database, you can simply import it as a backup into Cloudpepper and restore it to a Cloudpepper provisioned server supporting the newer version.

Step 3. Copying your filestore #

The upgrade you download from Odoo doesn’t contain the original filestore, so you will need to copy the filestore manually into the new instance.

If you’re going to restore the instance on the same server, you can just copy one filestore into the other:

Bash
cp -r -n /var/lib/odoo/.local/share/Odoo/filestore/original-database /var/lib/odoo/.local/share/Odoo/filestore/upgraded-database

However, if you need to copy to another server, that will be slightly harder:

Bash
ssh server01 tar -cf - -C /var/lib/odoo/.local/share/Odoo/filestore/original-database . | ssh server02 tar -xkf - -C /var/lib/odoo/.local/share/Odoo/filestore/upgraded-database