Cập nhật gỡ lỗi¶
Giới thiệu¶
In order to benefit from the latest improvements, security fixes, bug corrections and performance boosts, you may need to update your Odoo installation from time to time.
This guide only applies when are using Odoo on your own hosting infrastructure. If you are using one of the Odoo Cloud solutions, updates are automatically performed for you.
The terminology surrounding software updates is often confusing, so here are some preliminary definitions:
- Cập nhật (một cài đặt Odoo)
Refers to the process of obtaining the latest revision of the source code for your current Odoo Edition. For example, updating your Odoo Enterprise 13.0 to the latest revision. This does not directly cause any change to the contents of your Odoo database, and can be undone by reinstalling the previous revision of the source code.
- Nâng cấp (một cơ sở dữ liệu Odoo)
Chỉ một hoạt động xử lý dữ liệu phức tạp trong đó cấu trúc và nội dung cơ sở dữ liệu của bạn được thay đổi vĩnh viễn để tương thích với phiên bản mới của Odoo. Hoạt động này không thể được hoàn tác và thường được thực hiện thông qua dịch vụ nâng cấp cơ sở dữ liệu của Odoo, khi bạn quyết định chuyển sang phiên bản mới hơn. Thông thường, quá trình này cũng được gọi là "di chuyển" vì nó liên quan đến việc di chuyển dữ liệu trong cơ sở dữ liệu, dù cơ sở dữ liệu có thể vẫn nằm tại cùng một vị trí vật lý sau khi nâng cấp.
This page describes the typical steps needed to update an Odoo installation to the latest version. If you'd like more information about upgrading a database, please visit the Odoo Upgrade page instead.
Tóm tắt¶
Updating Odoo is accomplished by simply reinstalling the latest version of your Odoo Edition on top of your current installation. This will preserve your data without any alteration, as long as you do not uninstall PostgreSQL (the database engine that comes with Odoo).
The main reference for updating is logically our installation guide, which explains the common installation methods.
Updating is also most appropriately accomplished by the person who deployed Odoo initially, because the procedure is very similar.
Ghi chú
We always recommend to download a complete new up-to-date Odoo version, rather than manually applying patches, such as the security patches that come with Security Advisories. The patches are mainly provided for installations that are heavily customized, or for technical personnel who prefer to apply minimal changes temporarily while testing a complete update.
Step 1: Download an updated Odoo version¶
The central download page is https://www.odoo.com/page/download. If you see a "Buy" link for the Odoo Enterprise download, make sure you are logged into Odoo.com with the same login that is linked to your Odoo Enterprise subscription.
Alternatively, you can use the unique download link that was included with your Odoo Enterprise purchase confirmation email.
Ghi chú
Downloading an updated version is not necessary if you installed via Github (see below)
Step 2: Make a backup of your database¶
The update procedure is quite safe and should not alter you data. However it's always best to take a full database backup before performing any change on your installation, and to store it somewhere safe, on a different computer.
If you have not disabled the database manager screen (see here why you should), you can use it (link at bottom of your database selection screen) to download a backup of your database(s). If you disabled it, use the same procedure than for your usual backups.
Step 3: Install the updated version¶
Choose the method that matches your current installation:
Packaged Installers¶
Nếu bạn đã cài đặt Odoo bằng gói cài đặt được tải xuống trên trang web của chúng tôi (phương pháp được đề xuất), thì việc cập nhật diễn ra rất đơn giản. Tất cả những gì bạn phải làm là tải xuống gói cài đặt tương ứng với hệ thống (xem bước #1) và cài đặt nó trên máy chủ của mình. Chúng được cập nhật hàng ngày và bao gồm các bản sửa lỗi bảo mật mới nhất. Thông thường, bạn chỉ cần nhấp đúp vào gói để cài đặt nó trên bản cài đặt hiện tại. Sau khi cài đặt gói, hãy nhớ khởi động lại dịch vụ Odoo hoặc khởi động lại máy chủ của bạn. Thế là bạn đã hoàn tất.
Cài đặt Nguồn (Tarball)¶
If you have originally installed Odoo with the "tarball" version (source code archive), you have to replace the installation directory with a newer version. First download the latest tarball from Odoo.com. They are updated daily and include the latest security fixes (see step #1) After downloading the package, extract it to a temporary location on your server.
Bạn sẽ nhận được một thư mục được gắn nhãn với phiên bản mã nguồn, ví dụ "odoo-13.0+e.20190719", chứa một thư mục "odoo.egg-info" và thư mục mã nguồn thực tế có tên "odoo" (đối với Odoo 10 trở lên) hoặc "openerp" đối với các phiên bản cũ hơn. Bạn có thể bỏ qua thư mục odoo.egg-info. Xác định vị trí thư mục mà cài đặt hiện tại của bạn được triển khai và thay thế bằng thư mục "odoo" hoặc "openerp" mới hơn có trong tệp lưu trữ mà bạn vừa giải nén.
Hãy chắc chắn rằng bố cục thư mục trùng khớp, ví dụ thư mục "addons" mới có trong mã nguồn phải nằm chính xác tại cùng đường dẫn trước đó. Tiếp theo, hãy chú ý đến bất kỳ tệp cấu hình cụ thể nào mà bạn có thể đã sao chép hoặc sửa đổi thủ công trong thư mục cũ và sao chép chúng sang thư mục mới. Cuối cùng, hãy khởi động lại dịch vụ Odoo hoặc khởi động lại máy. Thế là bạn đã hoàn tất.
Cài đặt Nguồn (Github)¶
If you have originally installed Odoo with a full Github clone of the official repositories, the update procedure requires you to pull the latest source code via git. Change into the directory for each repository (the main Odoo repository, and the Enterprise repository), and run the following commands:
git fetch
git rebase --autostash
The last command may encounter source code conflicts if you had edited the Odoo source code locally. The error message will give you the list of files with conflicts, and you will need to resolve the conflicts manually, by editing them and deciding which part of the code to keep.
Alternatively, if you prefer to simply discard the conflicting changes and restore the official version, you can use the following command:
git reset --hard
Finally, restart the Odoo service or reboot the machine, and you should be done.
Docker¶
Please refer to our Docker image documentation for specific update instructions.