Upgrading Openbravo installations
Contents |
Introduction
The objective of this document is to explain the process of upgrading Openbravo ERP. There are two different methods of upgrading Openbravo ERP: using the upgraders or using Subversion.
This introduction gives some hints on how to choose the appropriate upgrade method. The next two sections explain both upgrade methods. Finally, Appendix A explains in detail how upgraders manage source code; Appendix B gives some details on the old upgraders; and Appendix C lists the known issues for the existing upgraders.
The upgraders are easier to use but you must take into account certain measures when developing on top of Openbravo ERP. On the other hand, Subversion is a little bit more complicated, but gives more visibility and is the recommended method if you have enough knowledge.
Using the upgraders
If you are using a version previous to 2.35MP1 please read also Appendix B: old upgraders |
These upgraders assume that you've installed Openbravo ERP through an installer (not from Subversion) and that you have all your developments inside the folder srcClient. If this is not the case, it is recommended to upgrade through Subversion, as you may loose some of your developments. If you want to understand how the upgrader manages your code, you can read Appendix A: upgraders' source management.
The available upgrades can be found at openbravo-updates Openbravo ERP project's download area. You need to select the appropriate upgrade depending on the version you are working with and the version you want to upgrade to. If you don't find an upgrader between those two versions, you may have to use more than one upgrader. If the upgrader you are looking for is not still in the list, please take a look at Openbravo ERP upgraders' status.
Before attempting any upgrade, it is recommended to first backup all your data; that is, a backup of the source code and a backup of the database. |
Download the latest Openbravo ERP Upgrader and execute it.
- If using Windows, double click on it.
- If using Linux, make it executable and run it:
chmod +x OpenbravoERP_2.35MP5-2.40beta-linux-upgrader.bin ./OpenbravoERP_2.35MP5-2.40beta-linux-upgrader.bin
An installation assistant (wizard) pops-up:
Read and accept Openbravo Public License Version 1.1 before proceeding with the installation process.
By clicking on Forward button the terms and conditions of this license are agreed.
Indicate the directory where Openbravo ERP is installed.
Provide the directory where Java Development Kit (JDK) is installed.
If the JDK has been properly installed, installation directory should be recognized automatically.
Provide the full path of the Apache Ant binary.
If Apache Ant has been properly installed, the binary path should be recognized automatically.
Provide the directory where Apache Tomcat is installed.
If Apache Tomcat has been properly installed, installation directory should be recognized automatically.
A popup reminds you to stop Tomcat now. Do so and click OK.
The upgrader detects which database is being used (Oracle or PostgreSQL).
Provide the full path of the database binaries.
These binaries are psql, vacuumdb and pg_restore in PostgreSQL, and imp, sqlplus in Oracle's case.
Click Forward to go ahead with the upgrade of Openbravo ERP.
Upgrading using Subversion
The following instructions are how things should work. However in your installation you may encounter more conflicts than expected due to the instability of DBSourceManager in previous versions. |
All Openbravo ERP code is stored in the Subversion repository at dev.openbravo.com. Current development is done in trunk. A tag is a snapshot of a project in time. A tag is made for each released version.
Developers may have an Openbravo ERP installation based on trunk. Trunk has the latest developments, but may not be stable. In fact, a new version is released (and a Subversion tag created) after QA team checks the developments made. In that moment the trunk is stable.
Production environment installations are based on a specific tag to assure stability. Therefore, when we want to upgrade using Subversion, we want to change from the tag of an old version to the tag of a new version. Let's see how this is done.
Subversion works with files and not with databases. Therefore, the first thing to do is to convert the database into text.
ant export.database
The next step is to change the tag our working copy is referring to: from the old tag to the new tag. This is done with the Subversion switch subcommand. This transforms an existing working copy to reflect a different branch.
svn switch https://dev.openbravo.com/svn/openbravo/tags/r2.35mp5/
The switch subcommand updates our working copy with code existing in the new tag preserving the changes that may have occurred in our working copy. During this update, conflicts may occur. These conflicts must be manually resolved.
The database must be updated from the updated XML files.
ant update.database
Then the application has to be compiled:
ant core.lib wad.lib trl.lib compile.complete war
And finally deployed:
ant deploy
Appendix A: upgraders' source management
If you have made developments on top of Openbravo ERP, please read this section carefully to ensure you don't loose any of your developments.
During the compilation process, the contents of srcClient folder are copied to src folder. If you use srcClient you have your developments clearly isolated.
However, this introduces a problem for the upgraders. Upgraders use the src folder of the new version and the srcClient folder of the old version. There are several scenarios in which developments could be lost:
- Developments made in src. The upgrader uses the src folder of the new version. Therefore, any development made in the old src will be lost.
- Existing files modified in srcClient. If you want to modify a file distributed by Openbravo, you could first copy it to srcClient and then make the modifications. In this way, you will avoid the previous problem. But after upgrading, the contents of srcClient would be copied into src and any enhancements done by Openbravo would be lost.
The only way not to loose developments is to store them with new file names (files not distributed by Openbravo) in srcClient folder.
Once understood how the upgrader works, feel free to choose how you want to work. For example, you may:
- Develop everything in new files in srcClient.
- Develop in srcClient (even modification to files distributed by Openbravo) and assume you'll loose improvements made by Openbravo in those files.
- Develop in src and manually taking care of adding your developments to the new version.
Appendix B: old upgraders
When using a version previous to 2.35MP1, you have to use the old upgraders. This upgraders force you to go through all the versions (e.g., if you want to upgrade from 2.34 to 2.35MP1, you'll need to do two upgrades: 2.34 -> 2.35 and 2.35 -> 2.35MP1). This upgraders are distributed as zip files and have different versions for Oracle and for PostgreSQL.
Upgrading Oracle version of the Openbravo ERP
The first step is to unzip the desired upgrade package and execute install.bat (Windows) or install.sh (Linux).
The installation window opens up and the following steps are required:
- Selection of a folder where the source and the database backup files from the actual installation will be saved.
- Introduction of the database access data (host, port, user, password, SID, and TNS)
- Selection of a folder with connection to the database library: ($CATALINA_HOME/common/lib)
- Introduction of the data corresponded to the sources and the Tomcat logs folders.
- Install
Once the installation is completed it's necessary to restart Tomcat and the user can access the updated application.
NOTE for Oracle: In case the database had not been created with UTF-8 character encoding the following actions are required:
If these actions are not done then data entry problems may occur. |
Upgrading PostgreSQL version of Openbravo ERP
The first step is to unzip the desired upgrade package and execute install.bat (Windows) or install.sh (Linux).
Known issue: During the installation and depending on the security level of PostgreSQL database, postgres may ask you for the password while executing the following tasks:
- Database backup
- Update database
There are two ways to avoid this:
1. Openbravo installer asks for an admin password for PostgreSQL, however Ubuntu/Debian and probably other distributions do not provide a default password
A possible workaround is:
1) Edit pg_hba.conf (located in /var/lib/postgresql/data or similar) and replace all the password or md5 strings by trust. For example, converting:
local all all md5
into:
local all all trust
2) Restart PostgreSQL (doing /etc/init.d/postgresql restart).
3) Change postgres user password:
psql -d postgres -U postgres alter role postgres with password 'new_password'; \q
4) Open pg_hba.conf again and replace all the trust strings by md5.
5) Restart PostgreSQL again
2. Execute the install.bat or install.sh from command line and be alert when the password is asked for
The installation window opens up and the following steps are required:
- Selection of a folder where the source and database backup files from the actual installation will be saved
- Introduction of the database access data (host, port, database name, user, and password)
- Selection of a folder with connection to the database library: ($CATALINA_HOME/common/lib)
- Introduction of the data referred to the sources and the Tomcat logs folders
- Install
Upgrading from the command line
It's also possible to upgrade an Openbravo ERP installation without the need of a graphical environment and using the command line. To do this you have to install the upgrade using the following command:
java -jar upgrader.jar text
Appendix C: Known issues
This section describes the known issues for specific versions of the upgrader. If you are using one of these upgraders, please take into account the instructions given in the workaround.
Upgrader 2.35mp5-2.40beta
The upgrader from 2.35MP5 to 2.40beta has the following known issues:
DATEPLANNED column
- Problem: The DATEPLANNED column in M_REQUISITIONLINE is being renamed to NEEDBYDATE. Therefore, a new column NEEDBYDATE has been created and the column DATEPLANNED has been marked as deprecated and will be removed in 2.50. However, the upgrader drops the column DATEPLANNED without copying the data to NEEDBYDATE.
- Workaround:
- In the new database (2.40beta) create the column DATEPLANNED in the table M_REQUISITIONLINE. Don't create the column in the application dictionary.
- Restore the database backup.
- Copy the DATEPLANNED data from the backup (2.35MP5) to DATEPLANNED and NEEDBYDATE of the new database.
Translations deleted
- Problem: The upgrader deletes any translations of the 2.35MP5 installation.
- Workaround: To prevent this, export the language before running the upgrader and import it it after the upgrade process is done.
In case you've already upgraded your version, restore the backup somewhere else, export the language you want, copy the attachments/lang/xx_XX directory to the target system in the same path, go to the upgraded Openbravo ERP and import it in your target system.
Upgraders 2.35MP4-2.35MP5, 2.40beta-2.40 and 2.35MP5-2.40
In case you get the following error during the upgrade process:
BUILD FAILED /tmp/OpenbravoERP_upgrader-2.35MP4-2.35MP5/upgradefiles/database_update/build.xml:289: The following error occurred while executing this line: /tmp/OpenbravoERP_upgrader-2.35MP4-2.35MP5/upgradefiles/database_update/src-db/database/build.xml:569: org.apache.ddlutils.dynabean.SqlDynaException: The dyna bean is not an instance of a SqlDynaClass
The upgrade process will stop. The steps are different depending on the upgrader you are executing.
If you are executing 2.35MP5-2.40 or 2.40beta-2.40 follow the next steps:
- Download this fixed dbsourcemanager.jar and place it in OpenbravoERP/AppsOpenbravo/src-db/database/lib, replacing the existing one.
- Go to OpenbravoERP/AppsOpenbravo and run the following command:
ant update.customized.database core.lib wad.lib trl.lib compile.complete war deploy
If you are executing 2.35MP4-2.35MP5 follow the next steps:
- Download this fixed dbsourcemanager.jar and place it in /tmp/OpenbravoERP_upgrader-2.35MP4-2.35MP5/upgradefiles/database_update/src-db/database/lib , replacing the existing one.
- Go to /tmp/OpenbravoERP_upgrader-2.35MP4-2.35MP5/upgradefiles/database_update/ and run the following command:
ant update.customized.database
- Go to OpenbravoERP/AppsOpenbravo and execute:
ant core.lib wad.lib trl.lib compile.complete war deploy
Categories: Installation | Release Management










