As part of the service, enterprise contract customers can expect early email notifications alerting them to this type of issue.
If you need a specific bug fix, however, an earlier update should be considered.Remember to also watch out for security bug disclosures on public channels such as GitHub Issues for Odoo, in particular, ones displaying the Security tag, at https://github.com/odoo/odoo/ issues?q=is%3Aissue+label%3ASecurity, or the Odoo official mailing lists, which can be subscribed to at https://www.odoo.com/groups.
After this is complete, we can pull the new versions to the production repository using Git and complete the upgrade as follows: $ sudo su odoo $ cd ~/odoo-12 $ git tag --force 12-last-prod $ git pull $ exit $ sudo service odoo restart # or: sudo systemctl restart odoo There's no point in updating too frequently, but it's not advised that you wait a year between updates either.Performing an update every few months is usually fine.Also note that a server restart should be enough to enable code updates—and that module upgrades aren't always necessary.
This will enable you to rollback any changes if necessary.Keeping a backup of the database before an upgrade is also highly advised.
If something goes wrong, we can revert the code to an earlier version with the following code: $ sudo su odoo $ cd ~/odoo-12 $ git checkout 12-last-prod $ exit If everything works as expected, it should be safe to perform an upgrade on the production service, which is usually done by restarting it.If you want to perform an actual module upgrade, the suggested approach is to stop the server, run the upgrade, and then restart the service, as follows: $ sudo service odoo stop $ sudo su -c "~/odoo-12/odoo-bin -c /etc/odoo/odoo.conf" \ " -u base --stop-after-init" odoo $ sudo service odoo start Remember to make a note of the Git reference in use by checking out the necessary version.
Now it's time to start the Odoo staging server, which will use the update code on it staging database, as follows: $ ~/odoo-12/odoo-bin -d odoo-stage --http-port=8080 \ -c /etc/odoo/odoo.conf # optionally add: -u base $ exit This Odoo staging server was configured to listen on the 8080 port.We can navigate there with our web browser, using an address such as http://localhost:8080, to check whether the upgraded code works correctly.
To get the latest Odoo source code from the GitHub repository, we use the git pull command.Before doing that, we can use the git tag command to create a tag for the current commit in use, so that it's easier to revert the code update, as follows: $ sudo su odoo $ cd ~/odoo-12 $ git tag --force 12-last-prod $ git pull For code changes to take effect, we need to restart the Odoo service.For data file changes to take effect, an upgrade to the modules is needed.As a general rule, changes to Odoo stable versions are considered code fixes, and it's therefore not often worth the risk of performing module upgrades.If you need to perform a module upgrade, however, it can be achieved using the -u additional option, or -u base, which upgrades all modules.