Release Management/Upgrading Demos
Contents |
Introduction
We being the Release management team, as a part of our daily work we need to keep demo servers updated to the latest OpenbravoERP release/MP. So this wiki is to guide any new person doing the same.
Pre-Requisites
- Recognize the Operating system as these steps failed for me in Ubuntu system.
- This document supposes as you are upgrading from the immediate previous MP of OpenbravoERP.
- Check that tomcat core directory is present and we can run another tomcat instance using that with openbravo user (on dofferent than standard port).
- Clone the source code of the existing version if not existing.
- Edit config/Openbravo.properties file to point to correct username/password and source path.
- Check permissions of source directory as it should be writeable by openbravo and tomcat users.
Steps to meet the Pre-Requisites
Note: Follow these steps only if pre-requisites are not met.
- Getting separate tomcat.
wget http://apache.cyberuse.com/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz
- Run another instance of tomcat as user openbravo
tar -xvzf apache-tomcat-6.0.20.tar.gz cd apache-tomcat-6.0.20
- Edit conf/server.xml to run tomcat on different port (eg. 8081), chage shutdown port to non-standard (eg. 8004) and comment line which listen to mod_kj (port 8009), And now run
bin/startup.sh Note: Make sure CATALINA_HOME and CATALINA_BASE are set as path to apache-tomcat-6.0.20 before running startup.sh Note: And remember to open the new port in EC2 security group (demo).
- Clone the source.
eg. hg clone -r 2.50MP2 https://code.openbravo.com/erp/devel/main /opt/openbravo
- Edit /opt/openbravo/config/Openbravo.properties
cd /opt/openbravo cp config/Openbravo.properties.template config/Openbravo.properties vi config/Openbravo.properties # And edit the username/password for db and system, point the source path to the above (/opt/openbravo). Note: Edit config/Openbravo.properties file to have new port for tomcat.
- Check permissions of source directory
chown openbrav:openbravo /opt/openbravo -R Note: Make sure openbravo user exists in tomcat group and visa-versa.
Process
- Login to the demo.openbravo.com via ssh
- Edit /usr/local/sbin/restoreOB script for not to run /usr/local/sbin/deactivate_options_ob_demo.sql OR rename this (/usr/local/sbin/deactivate_options_ob_demo.sql) file.
Note: this script deactivates the admin role and other features which are not required for demo servers
- Now run this to enable admin role, keeping in mind that openbravo.war file and tad.dmp (/usr/local/OpenbravoERP/src-db/database/tad.dmp) file are in there respective locations.
rm -rf /var/lib/tomcat-6/webapps/openbravo/ && unzip -q /tmp/openbravo.war -d /var/lib/tomcat-6/webapps/openbravo/ && chown tomcat:tomcat -R /var/lib/tomcat-6/webapps/openbravo/ &&/usr/local/sbin/restoreOB && /usr/local/sbin/restoreOB
- Browse through the http://demo.openbravo.com/openbravo to change to System Administrator role
Click on openbravo link on the left top corner and select the admin role.
- Download the latest OpenbravoERP OBX file.
wget http://downloads.sourceforge.net/project/openbravo/03-openbravo-updates/2.50MP3/OpenbravoERP-2.50.14398.obx?use_mirror=biznetnetworks Note: the link is of MP3 as OBX for MP4 is not present.
- Upload the obx file through the Openbravo console (http://demo.openbravo.com/openbravo)
General Setup => Application => Module Management => Add Modules => Browse File System Give the path of the file and press Continue.
- Create the War file for new MP.
cd /opt/openbravo # or what ever the path of source directory is. ant war # this will create war file /opt/openbravo/lib/openbravo.war
- Take database dump.
pg_dump -U tad -h localhost -F c -b -v -f /tmp/tad.dmp openbravo
- Deactivate options not required by demo server.
Note: enable /usr/local/sbin/deactivate_options_ob_demo.sql script and run rm -rf /var/lib/tomcat-6/webapps/openbravo/ && unzip -q /tmp/openbravo.war -d /var/lib/tomcat-6/webapps/openbravo/ && chown tomcat:tomcat -R /var/lib/tomcat-6/webapps/openbravo/ &&/usr/local/sbin/restoreOB && /usr/local/sbin/restoreOB
Replication
To replicate across the other demo servers either repeat the above whole process
OR
- Copy this new openbravo.war file and tad.dmp to to other systems
- Make sure the above files are at proper position and run
- tad.dmp at /usr/local/OpenbravoERP/src-db/database/tad.dmp
- openbravo.war at /tmp/openbravo.war or as mentiones in next command.
rm -rf /var/lib/tomcat-6/webapps/openbravo/ && unzip -q /tmp/openbravo.war -d /var/lib/tomcat-6/webapps/openbravo/ && chown tomcat:tomcat -R /var/lib/tomcat-6/webapps/openbravo/ &&/usr/local/sbin/restoreOB && /usr/local/sbin/restoreOB