How to do it...

To update the source code of Odoo, use the following command:

$ git pull –-ff-only origin 12.0

This will fetch the latest version of the source code that's committed to the current branch.

To update an instance running on this code, run the following command:

$ ./odoo-bin -c myodoo.cfg --stop-after-init -u base
-u is the shortcut notation for the --update option of odoo-bin.

If you don't have a database set in the configuration file, you will have to add the
-d database_name option. This command is to be repeated for all of the instances that are running with this version of the source code.

If the update fails, don't panic, because you have backups:

  1. Read the error message carefully and save it to a file, as it will be useful for making a bug report later.
  2. If you cannot figure out what the problem is, restore the service and the Odoo source code to the previous version, which is known to work using the tag you set before updating the source version:
$ git reset --hard 12.0-before-update-$(date --iso)
  1. Drop the broken databases and restore them from the backups you made (refer to the Managing Odoo server databases recipe of this chapter for instructions).
  2. Restart your instances and tell your users that the upgrade has been postponed.
Note that, in real life, this should never happen on a production database because you would have tested the upgrade beforehand on a copy of the database, fixed the issues, and only done the upgrade on the production server after ensuring that it runs flawlessly. However, you sometimes still get surprises, so even if you are really sure, make a backup.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset