Installation Steps of Apache OFBiz 16.0 in Ubuntu

Apache Open For Business Project is an open source ERP/CRM system from the Apache Foundation starting point for reliable, secure and scalable enterprise solutions. It offering complete accounting/ledger, inventory management, CRM, and project management systems.

Here, are the steps that we have followed for the Installation of Apache OFBiz 16.0:-

STEP 1:- Install JAVA

Firstly install java in your system which is primary requirement for installing Apache OFBiz. Run the following commands on terminal:-

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update

Install Java :-

$ sudo apt-get install oracle-java8-installer

After installation check the java version.

To check the installed version and switch to Java-8-oracle version for OFBiz run the command below:-

$ sudo update-alternatives --config java

This command will list all installed versions with current active marked and provides dialog to switch. There are 3 choices for the alternative java .

STEP 2:- Edit .bashrc file

Then edit JAVA_HOME Environment in .bashrc file.

$ vi .bashrc 
$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle

After making changes then I reloaded the .bashrc file with following command.

$ source ~/.bashrc

STEP 3:- Installing OFBiz

We are using 16.11.03(stable version).

Download Apache OFBiz here.

Note: Please choose a stable version under ‘Releases’ Section.

STEP 4:- Quick START

To quickly install and fire-up OFBiz, follow the below instructions:-

$ ./gradlew cleanAll loadDefault

STEP 5:- Start OFBiz

$ ./gradlew ofbiz

To check for the proper installation visit https://localhost:8443/ordermgr/control/main

USERNAME:- admin
PASWWORD:- ofbiz

Steps to migrate OFBiz from Derby to MySQL database

Step -1

Place the MySQL JDBC driver in build.gradle file.

dependencies {
pluginLibsCompile 'mysql:mysql-connector-java:5.1.6'
}

Step -2

Then, create three databases i.e ofbiz,ofbizolap,ofbiztenant then set there PASSWORD as mentioned in the below commands:-

C:\mysql-5.5.23-winx64\bin>mysql -u root
mysql>create database ofbiz;
mysql>create database ofbizolap;
mysql>create database ofbiztenant;
mysql>use mysql;
mysql>select database();
mysql>create user ofbiz@localhost;
mysql>create user ofbizolap@localhost;
mysql>create user ofbiztenant@localhost;
mysql>update user set password=PASSWORD(“ofbiz”) where User=’ofbiz’;
mysql>update user set password=PASSWORD(“ofbizolap”) where User=’ofbizolap’;
mysql>update user set password=PASSWORD(“ofbiztenant”) where User=’ofbiztenant’;
mysql>grant all privileges on *.* to ‘ofbiz’@localhost identified by ‘ofbiz’;
mysql>grant all privileges on *.* to ‘ofbizolap’@localhost identified by ‘ofbizolap’;
mysql>grant all privileges on *.* to ‘ofbiztenant’@localhost identified by ‘ofbiztenant’;

Step -3

  • Stop ofBiz server.
  • Create a backup of <ofbizdir>/framework/entity/config/entityengine.xml .
  • Edit entityengine.xml as follows and update the following datasources:

Replace derby with mysql in default, default-no-eca and test delegators as follows:-

Then, start ofbiz you will see the databases will be created as below :-

Follow commands to use created databases and have a look to the tables:-

Now, use the below tasks to load the data.

STEP 6:- Data loading tasks

OFBiz contains the following data reader types:-

  • seed:- OFBiz and External Seed Data — to be maintained along with source and updated whenever a system deployment is updated.
  • seed-initial:- OFBiz and External Seed Data — to be maintained along with source like other seed data, but only loaded initially and not updated when a system is updated except manually reviewing each line.
  • demo:- OFBiz Only Demo Data is loaded.
  • ext:- External General Data (custom)
  • ext-test:- External Test Data (custom)
  • ext-demo :- External Demo Data (custom)

You can choose which data readers to pass in the following syntax like I have chosen to seed,seed-initial,ext,ext-demo readers.

Example:

$ ./gradlew “ofbiz — load-data readers=seed,seed-initial,ext,ext-demo”

STEP 7:- Load default OFBiz data

Loads default data set; meant for initial loading of generic OFBiz data.
 Can be applied for development, testing, demonstration, etc. purposes.

The default data set is defined by datasource using the read-data attribute,
 followed by the name of the data set, into the datasource element of the ‘entityengine.xml’ file.

$ ./gradlew loadDefault

STEP 8:- Load seed data

Load ONLY the seed data (not seed-initial, demo, ext* or anything else);
 meant for use after an update of the code to reload the seed data
 as it is generally maintained along with the code and needs to be
 in sync for operation

$ ./gradlew "ofbiz --load-data readers=seed"

STEP 9 :- Load ext data

Load seed, seed-initial and ext data; meant for manual/generic
 testing, development, or going into production with a derived
 system based on stock OFBiz where the ext data basically
 replaces the demo data

$ ./gradlew "ofbiz --load-data readers=seed,seed-initial,ext"

After completion of installation, below are simple steps to be followed for creation of Ofbiz Component.

Steps for Creation of OFBiz Component

Ofbiz components resides in the specialpurpose directory. Plugins can be added manually or fetched from a maven repository. The standard tasks for create new plugin is giving below. To create a new plugin.

The following project parameters are passed:

  • PluginId: mandatory.
  • PluginResourceName: optional, default is the Capitalized value of pluginId
  • WebappName: optional, default is the value of pluginId
  • BasePermission: optional, default is the UPPERCASE value of pluginId

Enter following command below to create component/plugin:-

$ ./gradlew createPlugin -PpluginId=myplugin

or

$ ./gradlew createPlugin -PpluginId=myplugin -PpluginResourceName=MyPlugin -PwebappName=mypluginweb -PbasePermission=MYPLUGIN`

The above commands achieve the following:

  • create a new plugin in /specialpurpose/myplugin
  • add the plugin to /specialpurpose/component-load.xml

Once the component is created, you should load its data (required to grant access rights to the “admin” user);

$ ./gradlew “ofbiz — shutdown”
$ ./gradlew loadDefault
$ ./gradlew
$ ./gradlew ofbiz

Hope you have enjoyed. For more updates Stay tuned :)