Difference between revisions of "Adempiere Install for Windows & PostgreSQL"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(Introduction)
Line 3: Line 3:
 
This tutorial is for ''PostgreSQL Installation in Windows for Adempiere''
 
This tutorial is for ''PostgreSQL Installation in Windows for Adempiere''
  
The installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly. However, in this particualr version of Adempiere 342s there are a lot of things to do and it may take a few hours.
+
The installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly. However, in this particualr version of Adempiere 342s there are a lot of things to do and it may take longer.
  
 
Every detail in the method must be meticulously carried-out. Do not try to jump ahead or you will just need to retrace your steps and uninstall what you have done! ''[[Adempiere_Install_WinXp#Common_Reasons_for_errors_during_setup|Please briefly read Step 8 Common Reasons for errors during setup]] (see below)''
 
Every detail in the method must be meticulously carried-out. Do not try to jump ahead or you will just need to retrace your steps and uninstall what you have done! ''[[Adempiere_Install_WinXp#Common_Reasons_for_errors_during_setup|Please briefly read Step 8 Common Reasons for errors during setup]] (see below)''

Revision as of 15:33, 19 March 2009

Introduction

This tutorial is for PostgreSQL Installation in Windows for Adempiere

The installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly. However, in this particualr version of Adempiere 342s there are a lot of things to do and it may take longer.

Every detail in the method must be meticulously carried-out. Do not try to jump ahead or you will just need to retrace your steps and uninstall what you have done! Please briefly read Step 8 Common Reasons for errors during setup (see below)

Another alternative you might want to investigate is the developmental Windows Installer, which runs under Windows and installs everything you need. However, the following method will give you much more control over the installation including a choice of the latest packages.

Platform

This guide has been optimised for: Windows XP SP2, Java SE Development Kit (also called JDK) 6 Update 12, Postgres 8.3.7 & Adempiere 3.42s

Download each of the Java JDK, PostgreSQL and Adempiere packages before you begin! The sites are given below.

Setup Pre-Requisite

Step 1

NOTE: if you are using Windows VISTA, make sure UAC is turned off through user accounts.

You need to get the paths in Steps 1 & 2 absolutely right otherwise nothing else will work!

  • Install the JDK1.5.0_xx with the default installation settings. Install the follow-on JRE1.5.0_17 as well.
  • Open Explorer and navigate to the C:\Program Files\Java directory (or where-ever your Java is installed) and carefully note the jdk1.5.0_17 directory and the jre1.5.0_17 directory that you have just installed. There may well be a number of jdk and jre directories, so choose the right ones!
  • On your Desktop (or using Start button / My Computer) right click My Computer and select System Properties / Advanced / Environmental Variables

(Alternatively: Start > Control Panel > System > Advanced tab > Environmental Variables)

  • Add a new System Variable for your new JDK directory:

JAVA_HOME = C:\Program Files\Java\jdk1.5.0_17 (or whatever your JDK directory is called)

  • Add a new System Variable for your new JRE directory:

JRE_HOME = C:\Program Files\Java\jre1.5.0_17 (or whatever your JRE directory is called)

  • You can check you have the right variables by opening a DOS shell with Start Button / Run / Open: cmd

Run each of the following commands by selecting the text and then pasting into the shell using Right Click / Paste:

  • echo %JAVA_HOME% - carefully check the result to ensure the path to the JDK is correct
  • echo %JRE_HOME% - again, carefully check the result to ensure the path to the JRE is correct
  • exit - close the shell

Step 2

Again in My Computer / System Properties / Advanced / Environmental Variables:

  • In System Variables, scroll down to locate the Path variable and click Edit
  • Append the following JRE and PostgreSQL paths to the end of Path variable after putting in a connector semi-colon ";" (Note: do not delete or overwrite the paths that are already in the Path variable! Also, make sure you don't have an extra "\" at the end of C:\Program Files\PostgreSQL\8.3\bin)

International Version

C:\Program Files\Java\jre1.5.0_17\bin;C:\Program Files\Java\jre1.5.0_17\bin\client;C:\Program Files\PostgreSQL\8.3\bin

Italian Version

C:\Programmi\Java\jre1.5.0_17\bin;C:\Programmi\Java\jre1.5.0_17\bin\client;C:\Programmi\PostgreSQL\8.3\bin
  • Edit the commands that you just pasted to make sure that in each of the two JRE references you have referred to your latest JRE. You must do this exactly, so open Windows Explorer and navigate to C:\Program Files\Java and check the exact naming of the JRE directory!
  • Open a DOS shell with Start Button / Run / Open: cmd
  • Type PATH
  • Carefully check the result to ensure the two paths to the JRE are correct

Step 3

  • Extract the Adempiere zip file to C:\Adempiere (You must extract to the folder C:\Adempiere. Do not extract to C:\Program Files\Adempiere)
  • Make sure you have achieved that all the Adempiere files are directly in the C:\Adempiere directory and not in a chained directory like C:\Adempiere\Adempiere
  • Copy the substitution files that you downloaded above in repect to Detected installation problem in postgresql 8.3.5 from your desktop to C:\Adempiere\utils]postgresql where the will overwrite existing files
  • In C:\Adempiere\lib rename each of the files that will be patched with the files you have in C:\adpatches, such as patches.jar, by adding .ok to the file name to get names like patches.jar.ok. Note that for a new installation there may not already be a webuiOriginal.war, so an original file may not need to be renamed. Copy the patches files that you downloaded from C:\adpatches into C:\Adempiere\lib Now rename each of these files by deleting the descriptors and date so you just have names like the ones you renamed such as patches.jar.

Step 4

  • Unzip the PostgreSQL binary to a directory Postgres on your desktop (you can delete this and the zip file later)
  • Install PostgreSQL by double clicking the Windows installer postgresql-8.3.msi. If you are re-installing Postgresql then you need to stop the Postgresql Service (using Control Panel/Administrative Tools/Services), remove Postgresql (using Control Panel/Add or Remove Programs), remove the directory C:\Program Files\Postgresql\ and remove the user postgres by executing "net user postgres /delete" in a command shell.
  • Select your language to be used in the installation

Installation options:

  • ensure psql & pgAdminIII are also set as will be installed on local hard drive, which should be the case since these are the default options (Note: PL/Java is no longer required for Adempiere.)

Service configuration:

  • ensure the box "install as service" is checked (which is default, later you can set the service to manual start if you don't want PostgreSQL to run when you start-up)
  • Account name: postgres
  • Account domain: accept your computer name and remember it because you will need it later (IMHO I suggest that it is best for new users to write it down)
  • Password: postgres (or whatever you want - but write your password down! - let me repeat - !!write it down!!)
  • "Yes" to creating the user <your-domain>\postgres
  • "No" to replacing the weak password (in a commercial implementation you would have a strong password)

Initialise database cluster:

  • Check box "Initialize database cluster"
  • Do not check the Addresses box "accept connection on all addresses" - only listen on localhost
  • Select your Locale
  • Select UTF8 for both the server and client instead of the default WIN1252 (this is important)
  • Superuser name: postgres
  • Password: postgres (again, or whatever you want - but write it down!)
  • If you receive an error message that the port is already in use, you probably have an old Postgres service running. Go to Control Panel/Administrative Tools/Services, find Postgres Database Server, Stop the service and set its startup to Manual. Try again.

Enable procedural languages:

  • ensure PL/pgsql is checked

Enable contrib modules: You only need the default Adminpack

Install!

  • If you receive an error, install again with the above procedure and accept the suggestion not to create a new database cluster (because you created it last time).
  • Uncheck the box "Launch Stack Builder at exit" and Finish
  • Cancel out of Stack Builder if it insists in launching
  • Start Button/All Programs/PostgreSQL 8.3/Start Service

Congratulations, you now have Postgres database running

Suggestion: while the PostgreSQL database is being installed, you can save time by creating Desktop shortcuts to:

  • C:\Adempiere\Run_Setup.bat
  • C:\Adempiere\utils\RUN_ImportAdempiere.bat (the "bat" file designation may not be showing in your Explorer)
  • C:\Adempiere\utils\RUN_Server2.bat
  • C:\Adempiere\utils\RUN_Server2Stop.bat

Establish Adempiere

Step 1

Open pgAdmin III from Start Button / PostgreSQL / pgAdmin III

Step 2

Connect to postgresql

--Right click on the Postgresql database server and connect. --Enter password & tick the save box

Now, expand all the database server tree by clicking the plus-sign

Step 3

Down the bottom, you will see a user called "postgres". Do not modify this user. This database username will be entered during adempiere server setup or else you will have errors in dump restore.

Right click on Login Roles and create a new user "adempiere" with password "adempiere". Check superuser rights plus all boxes below superuser rights(see image below).


Bepi 001.jpg

Step 4

Now return to Database at the top and right click. Select create database. Name it "adempiere" and select the owner "adempiere" and encoding "UTF8" (see image below). Leave all the other variables blank.

Bepi 002.jpg


Note! If you installed PostgreSQL 8.2.1 (or later) with PL/Java then Skip to #Step 7 below

Step 5

Steps 5 & 6 are only for PostgreSQL 8.1 or earlier and where PL/Java has not already been installed.

Edit file C:\Programmi\PostgreSQL\8.2\data\postgresql.conf (C:\Program Files\PostgreSQL\8.2\data\postgresql.conf). Add the following lines:

International Version (POSTGRESQL 8.2 version adds the first 3 lines by default during Postgresql installation)

custom_variable_classes = 'pljava'
pljava.classpath = 'C:\\Program Files\\PostgreSQL\\8.2\\share\\pljava\\pljava.jar'  
pljava.release_lingering_savepoints = true
pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48'
pljava.debug = false

Italian Version

custom_variable_classes = 'pljava'
pljava.classpath = 'C:\\Programmi\\PostgreSQL\\8.1\\share\\pljava\\pljava.jar' 
pljava.release_lingering_savepoints = true
pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48'
pljava.debug = false
  • Connection Settings (* indicates listen for connections on all hosts, remember to specify the host ip addresses in pg_hba.conf file, otherwise you will get database connection refused error while installing adempiere, this option is set by postgresql installation if it this option is selected in version 8.2 during the installation)

listen_addresses = '*'


pg_hba.conf

  • TYPE DATABASE USER CIDR-ADDRESS METHOD

host all all 127.0.0.1/32 trust
host all all 192.168.1.1/24 trust

Step 6

Stop and restart PostgreSQL

Step 7

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\data
  • Run each of the following commands by selecting the text and then pasting into the shell using Right Click / Paste and running each with the password adempiere:
psql -U adempiere -d adempiere -c "drop schema sqlj cascade"

(don't worry if this gives an error because the schema doesn't exist)

psql -U adempiere -d adempiere -f Adempiere_pg.dmp >> dump_errors.log

(this will take a few minutes to run and there should be no errors - if you omitted to install the substitution files above then there will be errors!)

If you observe errors, you will need to check the file dump_errors.log to ensure no errors occur during import.


Adempiere Setup

Step 8 If you installed a Desktop Shortcut as suggested while you were waiting for PostgreSQL to install, then you can just click the Desktop icon RUN_setup (which is a program that can be run in the future as many times as you want to)

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\adempiere
  • launch RUN_setup.bat

Continuing:

  • Click the Test button
  • Accept the Licence and Keys provided
  • Put in the correct parameters until the Test gives no errors and accepts 5432 as the Database Port

You will need to change:

  • Database Server from <your-computer-name> to localhost
  • Database Type from oracleXE to postgresql
  • Database Name from xe to adempiere
  • System Password to postgres (or whatever you entered above for the database administrator)
  • Database Password to adempiere
  • Don't change anything in the Mail Server settings unless you want to set-up Adempiere for production purposes

Press the Test button

You may also need to change the following:

  • Adempiere Home to C:\Adempiere (if somehow it has been set to the wrong location)
  • Application Server Web Port to 8080 (if 80 is being used by something else) and SSL to 8443 (instead of 443)

When the Test is without errors (shows OK in bottom left hand corner of form), click the Save button at the bottom right, accept the license conditions and wait a few minutes until the deployment is finished and the Adempiere Server Setup screen disappears (don't be impatient!)

More details, in case it is not working: ServerSetupHelp

Common Reasons for errors during setup

  • Make sure you follow every instruction exactly because there are many small details that must be correct!
  • Error on JDK: install JDK (the JRE is not sufficient!)
  • If you change your Java then make sure you change the Environmental Variables JAVA_HOME, JRE_HOME, the two (or three) references in PATH, and the RUN_setup.bat "Java Home"
  • Web Port: probably port 80 is already used by other web server. You can use something like 8080 or 8088 (and correspondingly 8443 for the secure port)
  • If you get "Error Database Port (DB Server Port = 5432)", change the 'Database Server' from <your-computer-name> to localhost. The alternative is to use a fixed IP address on your server or desktop and put this address in the Database Server, or if you have a laptop then you need to install a loopback adapter
  • If you move the Adempiere directory (or update Adempiere) after already executing RUN_setup.bat, then you should delete the file adempiere.properties in C:\Documents & Settings\<your-user-name>
  • If you did not include in your path C:\Program Files\PostgreSQL\8.3\bin , then at Step 7 you will need to replace the psql command with:

International Version

C:\"Program Files"\PostgreSQL\8.3\bin\psql

Italian Version

C:\Programmi\PostgreSQL\8.3\bin\psql

German Version

C:\Programme\PostgreSQL\8.3\bin\psql

Import Adempiere example data

Step 9 :

If you installed a Desktop Shortcut as suggested while you were waiting for PostgreSQL to install, then you can just click the Desktop icon RUN_ImportAdempiere.

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\utils
  • Type 'RUN_ImportAdempiere.bat'

This will take a few minutes and generate a lot of "errors" which are not important!

Now the migrations scripts need to be run. Open a shell with Start Button/Run/cmd and change to the directory where you saved these scripts with cd C:\adscripts You can use dir/w to see the scripts. For each of the <number>.sql files run:

 psql -f <number>.sql adempiere adempiere

You will need to enter the password adempiere each time. (Note: If you executed RUN_ImportAdempiere ok above with no errors then there should be no errors in running the scripts.)

Run Adempiere

Step 10 Start the Application Server:

If you installed a Desktop Shortcut as suggested while you were waiting for PostgreSQL to install, then you can just click the Desktop icon RUN_Server2. To use Adempiere in the future, always start this server first.

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\utils
  • Type 'RUN_Server2.bat' and wait for the server to fully start - it will end this phase with "INFO [Server] JBoss .... Started in xx:xx:xx ms", which will be around 2 to 3 minutes

Later, to shut down the Application Server, you can either:

  • click the Desktop icon RUN_Server2Stop
  • crash the Server by just closing the shell

Step 11 Start the Adempiere Java Client: To start Adempiere, you can just click the light blue Desktop icon Adempiere.

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\
  • Type RUN_Adempiere.bat

This may either open a login screen or a connection setting window

  • if you have a login screen labeled connection, the Server will probably be a pink line. This normally means you need to fix some settings however, it is probably showing pink as this is your first login. Try to click the green tick and proceed to login. If you can't do this then you will need to click the pink line so the Adempiere Connection window opens
  • if you find yourself at the Adempiere Connection window, enter <your-computer-name> for the Application Host. Click Test Application Server and it should result in a green tick. In addition, it will sort out the Database parameters.
  • Click Test Database, which should also result in a green tick (Vista Users may need to sort out security as in the Note below)
  • Select the green tick to close the Adempiere Connection window

Note for Vista users: If when you Test Application Server you get a green tick but a red cross for Test Database you have a problem with PostgreSQL security on your computer. As a safety feature PostgreSQL will only let you access it if you are NOT an administrator, which helps to stop any hackers in the real world.

  • Solution-> Make a new user on your computer. Name it "postgres" and make sure its a standard user, NOT ADMIN. Now run the Setup.bat (same settings should still be there). Click save. Then run the RUN_Server2.bat and then RUN_Adempiere.bat. Do the test now and it should work. Also, for Test Application server use your computer name (ie Gregs_PC) but for the Database use localhost

Step 12 Create a Purchase Order to check that everything is working:

  • Login to Adempiere as GardenAdmin with password GardenAdmin. As mentioned above, you should be able to simply click the green tick, which may take a few seconds to move on to the next screen. Accept the defaults (or perhaps change the printer) and click the second green tick. Hey presto - the Java Client will open!
  • Select Menu tab
  • Select Requisition-to-Invoice / Purchase Order
  • You will see some pink fields, which means these fields must have values entered
  • Click the icon at the end of the Business Partner and a Business Partner Info window will open
  • Press Enter and all the Business Partners will show
  • Highlight Tree Farm or another partner, and click the green tick - fortunately, this turns all the pink items blue!
  • On the left menu, select PO Line (i.e. Purchase Order lines)
  • Click icon on the end of the Product field (which is the sixth field down on the left) and the Product Info window will open
  • Press Enter and all the Products should appear. If the Products do appear everything is operational!

To Exit:

  • Click the red cross to Exit
  • Close the Purchase Order window to Exit this PL/Java confirmation test.

Step 13 Congratulations!!!

Run Adempiere's HTML Client

You can use a Web Browser instead of the Java Client by pointing your browser to: http://<your-computer-name>/webui

login: GardenAdmin

password: GardenAdmin

  • on next screen:

role: GardenWorld Admin

client: GardenWorld

organisation: HQ (you need to select this from the dropdown box)

warehouse: HQ warehouse (will come up automatically)

Very Important - Migrate and Patch your Adempiere with all fixes to date

There is a new system of migrations and patches that you must deploy fully for your system to operate....