awsodoo

Upgrade Odoo

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

It is strongly recommended that you create a backup before starting the update process. If you have important data, it is advisable that you create and try to restore a backup to ensure that everything works properly.

WARNING: The process described in this section, only works in the same major version of Odoo (i.e. upgrading from Odoo11.x.y to Odoo11.x.z). If you want to upgrade between Odoo Major versions (i.e. upgrading from Odoo10.x to Odoo11.y) please check the Odoo Community Forum and this Odoo Community Association project.

  • Go to your Odoo installation and instead of logging in, click “Manage Databases”.

  • From this web interface, create a backup of the bitnami_odoo database.

  • Stop the running application.

  • Install a new version of Bitnami Odoo (or deploy a new server).

  • From the “Manage Databases” interface, restore the bitnami_odoo database.

  • Stop all servers except PostgreSQL and migrate your data as explained in the Migrate data to a new Odoo installation section.

Migrate data to a new Odoo installation

Once your Odoo installation has been updated, follow the steps below to migrate the data to a new installation.

Approach A: Bitnami installations using system packages
  • Stop monit and other services:

      $ sudo monit quit
      $ sudo /opt/bitnami/ctlscript.sh stop
      $ sudo /opt/bitnami/ctlscript.sh start postgresql
    
  • Start the Odoo server with the following parameters:

      $ sudo su odoo -c "/opt/bitnami/odoo/bin/odoo -c /opt/bitnami/odoo/conf/odoo.conf --workers 0 -d bitnami_odoo -u all --stop-after-init &"
    
  • Wait until the server is completely started and the modules updated. Check the start-up status in the Odoo log file as shown below:

      $ sudo tail -f /opt/bitnami/odoo/log/odoo-server.log
    

    The upgrade process is finished when the messages “INFO bitnami_odoo odoo.service: Hit CTRL-C again or send a second signal to force the shutdown” or “Odoo waiting for connections” appear in the log file.

  • Start all the servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

IMPORTANT: When importing the data, you will also be importing the Odoo users, including the admin user and its password.

Approach B: Self-contained Bitnami installations
  • Stop monit and other services:

      $ sudo monit quit
      $ sudo /opt/bitnami/ctlscript.sh stop
      $ sudo /opt/bitnami/ctlscript.sh start postgresql
    
  • Start the Odoo server with the following parameters:

      $ sudo su daemon -s /bin/bash -c "/opt/bitnami/python/bin/python3 /opt/bitnami/apps/odoo/bin/odoo-bin -c /opt/bitnami/apps/odoo/conf/odoo-server.conf --workers 0 -d bitnami_odoo -u all &"
    
  • Wait until the server is completely started and the modules updated. Check the start-up status in the Odoo log file as shown below:

      $ sudo tail -f /opt/bitnami/apps/odoo/log/production.log
    

    The upgrade process is complete when either of the messages “INFO bitnami_odoo odoo.service: Hit CTRL-C again or send a second signal to force the shutdown” or “Odoo waiting for connections” appear in the log file.

  • Start all the servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

IMPORTANT: When importing the data, you will also be importing the Odoo users, including the admin user and its password.

Upgrade only Odoo in the Bitnami Odoo Stack

This approach is not recommended because a new Odoo version may have new dependencies not included in your base stack.

Approach A: Bitnami installations using system packages

  • Load the Virtualenv environment for Odoo as a superuser:

      $ sudo su
      $ . /opt/bitnami/odoo/venv/bin/activate
    
  • Download and install the latest Odoo version. For example:

      $ cd /tmp/
      $ wget http://nightly.odoo.com/X.Y/nightly/src/odoo_X.Y.latest.tar.gz
      $ tar zxvf odoo_X.Y.latest.tar.gz
      $ cd odoo-X.Y-VERSION
      $ pip install -r requirements.txt
      $ python3 setup.py install --install-scripts=/opt/bitnami/odoo/bin --install-lib=/opt/bitnami/odoo/lib
    
  • Update the paths in odoo.pth to match the new versions:

      $ find /opt/bitnami/odoo/lib -mindepth 1 -maxdepth 1 -type d | tee /opt/bitnami/odoo/venv/lib/python*/site-packages/odoo.pth
    
  • Disable the Virtualenv environment for Odoo:

      $ deactivate
    

Approach B: Self-contained Bitnami installations

  • Download and install the latest Odoo version. For example:

      $ cd /tmp/
      $ wget http://nightly.odoo.com/X.Y/nightly/src/odoo_X.Y.latest.tar.gz
      $ tar zxvf odoo_X.Y.latest.tar.gz
      $ cd odoo-X.Y-VERSION
      $ sudo python3 setup.py install --prefix=/opt/bitnami/apps/odoo --install-lib=/opt/bitnami/apps/odoo/lib
      $ sudo chown -R daemon:daemon /opt/bitnami/apps/odoo/lib
    
  • Change the line

      #!/opt/bitnami/python/bin/.python2.7.bin
    

    to

      #!/opt/bitnami/python/bin/python3
    

    in the /opt/bitnami/apps/odoo/bin/odoo-bin file.

  • Update your configuration to point to this version of Odoo. Edit the /opt/bitnami/apps/odoo/conf/odoo-server.conf file and replace the addons path to point to the new Odoo version.

Last modification July 8, 2021