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)
m (XML - Since Release 3.8.0)
 
(195 intermediate revisions by 8 users not shown)
Line 1: Line 1:
== Introduction ==
+
[[Category:Developer documentation]]
 +
[[Category:Documentation]]
 +
[[Category:User documentation]]
 +
[[Category:HowTo]]
 +
[[Category:Installation]]
 +
{{Breadcrumb|Table of Contents|Getting Started|Installing ADempiere Manually|next=Launching the ADempiere Application}}
  
This tutorial is for ''PostgreSQL Installation in Windows for Adempiere''
+
This install process applies to Windows operating systems and the PostgreSQL database.
  
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.
+
== Introduction ==
  
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)''
+
This installation instruction is intended for initial installations where the database, application server and client all run on the same machine. For more complex installations, see [[Installation Steps]].
  
Another alternative you might want to investigate is the developmental [[Windows_Installer|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.
+
An installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly.
  
== Platform ==
+
Other alternatives you might want to investigate are the [[Windows_Installer|Windows Installer]] or VMWare/VirtualBox AVA packages. However, the following method will give you much more control over the installation including upgrades with the latest patches and scripts.
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
+
{{Note|Make sure that User Account Control (UAC) is turned off through user accounts or be sure to run the processes with administrative privileges. To start a DOS shell with Admin rights, go to the start menu ({{MenuRef|Start|All Programs|Accessories}}), right-click on the "Command Prompt" icon and select "Run as Administrator".}}
  
[[Download each of the Java JDK, PostgreSQL and Adempiere packages before you begin! The sites are given below.]]
+
== Downloads ==
* Download the Java SE Development Kit JDK1.5.0_17 or later (also just called JDK5 for short) from http://java.sun.com/javase/downloads/index_jdk5. You only need the ''JDK 5 Update xx'' without EE or NetBeans. (Note: The performance of Adempiere with JDK6 has not yet been confirmed so you may experience errors if you use it.)
+
* Download the latest Adempiere release 342s from http://sourceforge.net/projects/adempiere/
+
* At http://adempiere.com/wiki/index.php/Release_342s go to the section ''Detected installation problem in postgresql 8.3.5'' and download the necessary substitution files to your desktop (this is very important)
+
* Again from http://adempiere.com/wiki/index.php/Release_342s pick the link to Adempiere patches and download the latest Adempiere patches. Save each of these to a new folder C:\adpatches
+
* Again from http://adempiere.com/wiki/index.php/Release_342s pick the link to Adempiere scripts and download the latest Adempiere scripts. NOTE: Be sure to get the scripts from the postgreql sub-directory rather than the directory you first see when you click the link! Save each of these to a new folder C:\adscripts. Rename each of the files as just <number>.sql
+
* Download to your Desktop the PostgreSQL ''postgresql-8.3.7-1.zip'' binary or later from http://www.postgresql.org/ftp/binary
+
  
== Setup Pre-Requisite ==
+
Before you begin, download each of the following packages:
=== Step 1 ===
+
* '''Java SE Development Kit''' - Get the latest from [http://java.sun.com/javase/downloads/index.jsp http://java.sun.com/javase/downloads/index.jsp]. You only need the ''JDK'' without JavaFX, EE or NetBeans bundles.
 +
* '''Postgre SQL''' - Get the latest Windows install from [http://www.postgresql.org/download/windows http://www.postgresql.org/download/windows].
 +
* '''ADempiere Latest Release''' - Download the latest Adempiere from [http://sourceforge.net/projects/adempiere/files/ADempiere%20Official%20Release/ http://sourceforge.net/projects/adempiere/files/ADempiere Official Release].
 +
* '''ADempiere Patches''' - From [http://sourceforge.net/projects/adempiere/files/ADempiere%20Patches/ http://sourceforge.net/projects/adempiere/files/ADempiere Patches/] download the patches for the version of ADempiere downloaded above. The patches come in two files, a *_patches_*.jar and a *_migra_*.zip. You will need both.
  
NOTE: if you are using Windows VISTA, make sure UAC is turned off through user accounts.
+
== Install the Pre-Requisites ==
 +
=== JAVA ===
  
You need to get the paths in Steps 1 & 2 absolutely right otherwise nothing else will work!
+
Install the JAVA JDK with the default installation settings. Say OK to install the follow-on JRE as well.
  
* Install the JDK1.5.0_xx with the default installation settings. Install the follow-on JRE1.5.0_17 as well.
+
Open Windows Explorer and navigate to the C:\Program Files\Java directory (or where-ever your Java is installed) and carefully note the full path for the JDK directory (e.g: C:\Program Files\java\jdk1.5.0_19) and the JRE directory that you have just installed.  
* 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!
+
{{Note|There may well be a number of JDK and JRE directories, so choose the right one! The JDK should include the JRE.}}
* 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)
+
==== Set the JAVA Environment Variables ====
 +
{{Caution|You need to get the paths below absolutely right or nothing else will work! No pressure.}}
  
* Add a new System Variable for your new JRE directory:
+
On your Desktop (or using Start button / My Computer) right click My Computer and select System Properties / Advanced / Environmental Variables. (Alternatively: {{MenuRef|Start|Control Panel|System|Advanced tab|Environmental Variables}}.)
  
JRE_HOME = C:\Program Files\Java\jre1.5.0_17  (or whatever your JRE directory is called)
+
Add a new System Variable JAVA_HOME for your new JDK directory:
  
* You can check you have the right variables by opening a DOS shell with Start Button / Run / Open: cmd
+
: JAVA_HOME ''use'' C:\Program Files\Java\jdk1.5.0_19  ''(or whatever your JDK directory is called)''
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 ===
+
Back in My Computer / System Properties / Advanced / Environmental Variables, find the '''Path''' variable and click Edit.
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 JDK path to the end of Path variable after putting in a connector semi-colon ";"  
* 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)
+
%JAVA_HOME%\bin
 +
{{Caution|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 path.}}
  
'''International Version'''
+
=== PostgreSQL ===
 +
{{Note|You can use an existing installation of PostgreSQL if you already have one.  If so, gather the passwords for the postgres user, check the environment variable and path, verify that the service is running and move on to the next step.}}
 +
Install PostgreSQL by running the Windows executable installer downloaded above. If you have problems, refer to [[Database_Server_Installation_%26_Setup#PostgreSQL_Installation_.26_Setup|PostgreSQL Installation & Setup]] for details.
  
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
+
'''Installation options:'''
 +
: Account name: postgres
 +
: Password: postgres (or whatever you want - but write your password down! - let me repeat - !!write it down!!)
 +
: Port 5432 (the default port)
 +
{{Note|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.}}
 +
: Select your Locale and make sure the "pl/pgsql" box is ticked (which is the default)
 +
: Uncheck the box "Launch Stack Builder at exit" and Finish. Cancel out of Stack Builder if it insists in launching
  
'''Italian Version'''
+
Create an environment variable POSTGRES_HOME set to the PostgreSQL install directory, for example "C:\Program Files\PostgreSQL\8.4"
  
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 PATH variable again and add %POSTGRES_HOME%\bin to the end of the path. This will make it easy to run the psql command from any directory.
  
* 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!
+
In a DOS shell, type PATH and carefully check the result to ensure the JAVA and Postgres paths are correctly added to the PATH.
  
* Open a DOS shell with Start Button / Run / Open: cmd
+
Start the PostgreSQL service.  There will be a menu item in the PostgreSQL Start Menu to start the PostgreSQL service.  It may already be running following the install.  Check the running Services (Control Panel/Administrative Tools/Services).
* 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.
 
**If you are using Vista then you need to deactivate User Access Control from Control Panel and install PostgreSQL using the Windows msi installer by right clicking and selecting Run AS Administrator. If you don't  have "Run As Administrator" on the context menu, then install the following registry fix: http://juice.altiris.com/download/1382/msi-run-as-administrator-context-menu-for-vista
 
* 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'''
 
'''Congratulations, you now have Postgres database running'''
 +
{{Caution|If for some twisted reason you also have Oracle running on the same machine as PostgreSQL, be aware that the two databases include some executables with the same name.  If you have both POSTGRES_HOME and the equivalent ORACLE_HOME on the path, you might have errors when running some of the ADempiere scripts.  Try to keep the path pointing to one or the other database at a time and switch between the two as required.}}
  
Suggestion: while the PostgreSQL database is being installed, you can save time by creating Desktop shortcuts to:
+
== Install the ADempiere Software ==
* C:\Adempiere\Run_Setup.bat
+
=== New installation ===
* C:\Adempiere\utils\RUN_ImportAdempiere.bat (the "bat" file designation may not be showing in your Explorer)
+
There is no install script.  Just extract the Adempiere archive to <drive letter>:\ (e.g. c:\). For reference, call this directory $ADEMPIERE_ROOT. You should end up with the files in a folder like $ADEMPIERE_ROOT\Adempiere. For reference, call this folder $ADEMPIERE_HOME. 
* C:\Adempiere\utils\RUN_Server2.bat
+
{{Note|'''Do not extract to C:\Program Files\Adempiere'''.  The batch scripts do not like directory names with spaces. If using a $ADEMPIERE_ROOT with multiple directories, avoid directory names with spaces.}}
* C:\Adempiere\utils\RUN_Server2Stop.bat
+
  
== Establish Adempiere ==
+
=== Updating or Migrating to a More Recent Version ===
 +
{{Caution|Back up your database before attempting to update. There is no way to revert a database to an earlier version once you have migrated to an newer one.}}
 +
In the existing installation, save/rename any needed files (such as customization.jar).  If you are not sure about this, it probably doesn't apply in your case.
  
=== Step 1 ===
+
Delete the contents of the following directories:
Open pgAdmin III from Start Button / PostgreSQL / pgAdmin III
+
* $ADEMPIERE_HOME\migration (since 3.8.0)
 +
* $ADEMPIERE_HOME\lib
 +
* $ADEMPIERE_HOME\jboss
 +
Then extract the new ADempiere archive to the $ADEMPIERE_ROOT directory.
 +
{{Note|It is helpful to make a full backup of the $ADEMPIERE_HOME directory in case you need to revert.}}
  
=== Step 2 ===
+
=== Apply the Patches ===
Connect to postgresql
+
Patches are a combination of *.jar files, which replace *.jar files in the $ADEMPIERE_HOME\lib directory, and migration scripts which update the database.  In the Patches directory on Source Forge, there may be more than one type of *.jar that needs patching.  If you downloaded one or more patch files, replace the existing file with the downloaded one, changing its name to match.  For example, copy the *_patches_*.jar file to $ADEMPIERE_HOME\lib\patches.jar, overwriting the existing file. See the detailed instructions in [[Patches Installation]].
 +
{{Note|If you are updating a patch file, it is a good idea to rename the existing *.jar file to something like patches.jar.old.}}
  
--Right click on the Postgresql database server and connect.
+
=== Apply Customizations, Packages and other Files ===
--Enter password & tick the save box
+
If you have a customization.jar with customized code or a packages.jar file with supporting *.jar files, add them to the $ADEMPIERE_HOME\lib directory, overwriting the existing files.
  
Now, expand all the database server tree by clicking the plus-sign
+
Also, if you have other customized files, such as *.bat files, a CustomReport.war file, etc..., don't forget to add them.  If you don't know what this means, it doesn't apply to you. Yet. (It is useful to developers who want to add customized components to the install.)
  
=== Step 3 ===
+
== Initial ADempiere Setup ==
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).
+
A setup utility in ADempiere will prepare the software for use and create environment variables needed in the following steps.
  
 +
Open a DOS shell with administrative privileges. Admin privileges are important here as the setup process will need to set environment variables. 
  
[[Image:bepi_001.jpg|center]]
+
Navigate to $ADEMPIERE_HOME and execute RUN_setup.bat.  If this is the first time you are running this, a licence and security keys dialogs will appear.  Accept the defaults.
  
=== Step 4 ===
+
The setup dialog will appear.
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.
+
 
+
[[Image:bepi_002.jpg|center]]
+
 
+
 
+
 
+
'''''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<br>
+
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:
 
You will need to change:
 
* Database Server from <your-computer-name> to localhost
 
* Database Server from <your-computer-name> to localhost
 
* Database Type from oracleXE to postgresql
 
* Database Type from oracleXE to postgresql
* Database Name from xe to adempiere
+
* Database Name from xe to adempiere (You can use another name here if you like)
 
* System Password to postgres (or whatever you entered above for the database administrator)
 
* System Password to postgres (or whatever you entered above for the database administrator)
 
* Database Password to adempiere
 
* Database Password to adempiere
 
* Don't change anything in the Mail Server settings unless you want to set-up Adempiere for production purposes
 
* 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:
 
You may also need to change the following:
  
* Adempiere Home to C:\Adempiere (if somehow it has been set to the wrong location)
+
* Adempiere Home to $ADEMPIERE_HOME (e.g. 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)
 
* 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!)'''
+
'''Press the Test button'''
  
More details, in case it is not working: [[ServerSetupHelp]]
+
When the Test completes without errors and the Save button (bottom, right) is activated, click the Save button. Wait a few minutes until the Adempiere Server Setup screen disappears and the deployment is finished.
 +
{{Note|The database does not have a user adempiere or a database adempiere at this point, so these tests will not be checked.  The user and database will be created in the next step.}}
  
==Common Reasons for errors during setup==
+
If you are having problems, see the detailed instructions on this dialog in the pages [[InstallServer]] and [[ServerSetupHelp]]
 +
{{Note|The setup process will have created several files in the $ADEMPIERE_HOME and $ADEMPIERE_HOME\utils directories with names like adempiere.properties, adempiereEnv.properties and myEnvironment.bat.  The adempiere.properties file can be copied to a new name and a different properties file created to, for example, create a sandbox version of the database with a database name like adempiere_sandbox.}} 
 +
=== Import ADempiere Example Data ===
 +
{{Caution|The following script will <b>DROP</b> any existing adempiere database.  Do not run this command if you already have data loaded.}}
 +
Open a DOS shell.
  
* Make sure you follow every instruction exactly because there are many small details that must be correct!
+
Navigate to $ADEMPIERE_HOME\utils and type ''''RUN_ImportAdempiere.bat''''.
* 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'''
+
See [[CreateDatabase]] for more information.
  
C:\"Program Files"\PostgreSQL\8.3\bin\psql
+
=== Apply Migration Scripts ===
 +
{{Note|Prior to release 3.8.0, database migrations were performed using SQL scripts. From 3.8.0 onwards, the scripts are in XML. If you are migrating from an earlier version to a version 3.8.0 or later, you will need to apply the SQL to get to the start of the XML process and then apply the XML scripts from then on. For more information, see [[Migration]].}}
 +
The database installed above will be at the state of the release version and will have all migration scripts applied.  If you are migrating an existing database to a new version or applying patches, you will also need to apply migration scripts to modify the database to keep it in sync with the software. 
  
'''Italian Version'''
+
If you are not installing patches or migrating an existing database, skip this step.
 +
==== SQL - Prior to Release 3.8.0 ====
 +
The migration scripts can be found in the *_migra_*.zip file downloaded above.  Unzip the contents to a convenient directory.
  
  C:\Programmi\PostgreSQL\8.3\bin\psql
+
Open a DOS shell and change to the directory where you saved these scripts. The script should all have a preface number. Starting at the lowest number and ascending, for each of the *.sql files, run:
  
'''German Version'''
+
: psql -f <number>.sql adempiere adempiere
  
C:\Programme\PostgreSQL\8.3\bin\psql
+
You will need to enter the password ''adempiere'' each time.  
  
== Import Adempiere example data ==
+
If there is a tediously large number of scripts, try the following:
'''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'''.
+
# Setup a ''''.pgpass'''' file according to the instructions for your version of PostgreSQL (for 8.4, see [http://www.postgresql.org/docs/8.4/static/libpq-pgpass.html 30.14. The Password File]).  This will prevent the password entry each time you run the psql command.
 +
# From a DOS shell, navigate to the directory where the scripts are located and execute this command:
 +
#:: FOR %N IN (*.sql) DO psql -f %N adempiere adempiere
  
Otherwise:
+
==== XML - Since Release 3.8.0 ====
 
+
The XML migration scripts to apply should be saved in the $ADEMPIERE_HOME\migration directory. These scripts will be included in *_migra_*.zip file. Unzip the contents to $ADEMPIERE_HOME\migration.
* Open a DOS shell with Start Button / Run / Open: cmd
+
    
* Navigate to C:\Adempiere\utils
+
To apply the scripts, execute the command $ADEMPIERE_HOME\utils\RUN_MigrateXML.bat from a dos shell.
* 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 ==
 
== Run Adempiere ==
  
'''Step 10 Start the Application Server''':
+
=== 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.
+
Open a DOS shell
 +
Navigate to $ADEMPIERE_HOME\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 take around 2 to 3 minutes.
 +
{{Note|Leave this DOS shell running.  Later, to shut down the Application Server, you can either RUN_Server2Stop in another DOS Shell or simply close the shell.}}
  
Otherwise:
+
=== Starting the Application Server Automatically ===
  
* Open a DOS shell with Start Button / Run / Open: cmd
+
If you would like to run the server as a service, in a DOS shell, navigate to $ADEMPIERE_HOME\utils\windows and run Adempiere_Service_Install.bat. You will need to open the Services Window ({{MenuRef|Control Panel|Administrative Tools|Services}}) to set the properties so the service starts automatically or manually.
* 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:
+
== [[Launching the ADempiere Application]] ==
* click the Desktop icon RUN_Server2Stop
+
''''Congratulations!''''
* crash the Server by just closing the shell
+
  
'''Step 11 Start the Adempiere Java Client''':
+
At this point, your installation is complete and you can move on to [[Launching the ADempiere Application]].
To start Adempiere, you can just click the light blue Desktop icon '''Adempiere'''.
+
== Uninstall or Revert to Previous Version ==
 +
To uninstall the software, simple delete the $ADEMPIERE_HOME directory.  To delete the database, use the database administrator to drop the adempiere database and user.
  
Otherwise:
+
To revert to the previous version, delete the $ADEMPIERE_HOME directory and copy the previous version to $ADEMPIERE_HOME. Restore the backed-up copy of the database using $ADEMPIER_HOME\utils\RUN_DBRestore.bat.
 
+
* 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....
+
* http://adempiere.com/wiki/index.php/Release_342s
+
* See [[Patches_Installation]] for a manual on how to install patches.
+
+
[[Category:Developer documentation]]
+
[[Category:Documentation]]
+
[[Category:HowTo]]
+

Latest revision as of 04:44, 2 January 2015

Table of Contents{{#if: Getting Started| | Getting Started }}{{#if: Installing ADempiere Manually| | Installing ADempiere Manually }}{{#if: | | [[{{{4}}}]] }}{{#if: | | [[{{{5}}}]] }} | Adempiere Install for Windows & PostgreSQL{{#if: Launching the ADempiere Application| | Launching the ADempiere Application }} ⇒

This install process applies to Windows operating systems and the PostgreSQL database.

Introduction

This installation instruction is intended for initial installations where the database, application server and client all run on the same machine. For more complex installations, see Installation Steps.

An installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly.

Other alternatives you might want to investigate are the Windows Installer or VMWare/VirtualBox AVA packages. However, the following method will give you much more control over the installation including upgrades with the latest patches and scripts.

Note.gif Note:

Make sure that User Account Control (UAC) is turned off through user accounts or be sure to run the processes with administrative privileges. To start a DOS shell with Admin rights, go to the start menu (Start{{#if: All Programs | →All Programs }}{{#if: Accessories | →Accessories }}{{#if: | → }}), right-click on the "Command Prompt" icon and select "Run as Administrator".

Downloads

Before you begin, download each of the following packages:

Install the Pre-Requisites

JAVA

Install the JAVA JDK with the default installation settings. Say OK to install the follow-on JRE as well.

Open Windows Explorer and navigate to the C:\Program Files\Java directory (or where-ever your Java is installed) and carefully note the full path for the JDK directory (e.g: C:\Program Files\java\jdk1.5.0_19) and the JRE directory that you have just installed.

Note.gif Note:

There may well be a number of JDK and JRE directories, so choose the right one! The JDK should include the JRE.

Set the JAVA Environment Variables

Caution.gif Caution!

You need to get the paths below absolutely right or nothing else will work! No pressure.

On your Desktop (or using Start button / My Computer) right click My Computer and select System Properties / Advanced / Environmental Variables. (Alternatively: Start{{#if: Control Panel | →Control Panel }}{{#if: System | →System }}{{#if: Advanced tab | →Advanced tab }}.)

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

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

Back in My Computer / System Properties / Advanced / Environmental Variables, find the Path variable and click Edit.

Append the following JDK path to the end of Path variable after putting in a connector semi-colon ";"

%JAVA_HOME%\bin
Caution.gif Caution!

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 path.

PostgreSQL

Note.gif Note:

You can use an existing installation of PostgreSQL if you already have one. If so, gather the passwords for the postgres user, check the environment variable and path, verify that the service is running and move on to the next step.

Install PostgreSQL by running the Windows executable installer downloaded above. If you have problems, refer to PostgreSQL Installation & Setup for details.

Installation options:

Account name: postgres
Password: postgres (or whatever you want - but write your password down! - let me repeat - !!write it down!!)
Port 5432 (the default port)
Note.gif Note:

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.

Select your Locale and make sure the "pl/pgsql" box is ticked (which is the default)
Uncheck the box "Launch Stack Builder at exit" and Finish. Cancel out of Stack Builder if it insists in launching

Create an environment variable POSTGRES_HOME set to the PostgreSQL install directory, for example "C:\Program Files\PostgreSQL\8.4"

Edit the PATH variable again and add %POSTGRES_HOME%\bin to the end of the path. This will make it easy to run the psql command from any directory.

In a DOS shell, type PATH and carefully check the result to ensure the JAVA and Postgres paths are correctly added to the PATH.

Start the PostgreSQL service. There will be a menu item in the PostgreSQL Start Menu to start the PostgreSQL service. It may already be running following the install. Check the running Services (Control Panel/Administrative Tools/Services).

Congratulations, you now have Postgres database running

Caution.gif Caution!

If for some twisted reason you also have Oracle running on the same machine as PostgreSQL, be aware that the two databases include some executables with the same name. If you have both POSTGRES_HOME and the equivalent ORACLE_HOME on the path, you might have errors when running some of the ADempiere scripts. Try to keep the path pointing to one or the other database at a time and switch between the two as required.

Install the ADempiere Software

New installation

There is no install script. Just extract the Adempiere archive to <drive letter>:\ (e.g. c:\). For reference, call this directory $ADEMPIERE_ROOT. You should end up with the files in a folder like $ADEMPIERE_ROOT\Adempiere. For reference, call this folder $ADEMPIERE_HOME.

Note.gif Note:

Do not extract to C:\Program Files\Adempiere. The batch scripts do not like directory names with spaces. If using a $ADEMPIERE_ROOT with multiple directories, avoid directory names with spaces.

Updating or Migrating to a More Recent Version

Caution.gif Caution!

Back up your database before attempting to update. There is no way to revert a database to an earlier version once you have migrated to an newer one.

In the existing installation, save/rename any needed files (such as customization.jar). If you are not sure about this, it probably doesn't apply in your case.

Delete the contents of the following directories:

  • $ADEMPIERE_HOME\migration (since 3.8.0)
  • $ADEMPIERE_HOME\lib
  • $ADEMPIERE_HOME\jboss

Then extract the new ADempiere archive to the $ADEMPIERE_ROOT directory.

Note.gif Note:

It is helpful to make a full backup of the $ADEMPIERE_HOME directory in case you need to revert.

Apply the Patches

Patches are a combination of *.jar files, which replace *.jar files in the $ADEMPIERE_HOME\lib directory, and migration scripts which update the database. In the Patches directory on Source Forge, there may be more than one type of *.jar that needs patching. If you downloaded one or more patch files, replace the existing file with the downloaded one, changing its name to match. For example, copy the *_patches_*.jar file to $ADEMPIERE_HOME\lib\patches.jar, overwriting the existing file. See the detailed instructions in Patches Installation.

Note.gif Note:

If you are updating a patch file, it is a good idea to rename the existing *.jar file to something like patches.jar.old.

Apply Customizations, Packages and other Files

If you have a customization.jar with customized code or a packages.jar file with supporting *.jar files, add them to the $ADEMPIERE_HOME\lib directory, overwriting the existing files.

Also, if you have other customized files, such as *.bat files, a CustomReport.war file, etc..., don't forget to add them. If you don't know what this means, it doesn't apply to you. Yet. (It is useful to developers who want to add customized components to the install.)

Initial ADempiere Setup

A setup utility in ADempiere will prepare the software for use and create environment variables needed in the following steps.

Open a DOS shell with administrative privileges. Admin privileges are important here as the setup process will need to set environment variables.

Navigate to $ADEMPIERE_HOME and execute RUN_setup.bat. If this is the first time you are running this, a licence and security keys dialogs will appear. Accept the defaults.

The setup dialog will appear.

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 (You can use another name here if you like)
  • 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

You may also need to change the following:

  • Adempiere Home to $ADEMPIERE_HOME (e.g. 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)

Press the Test button

When the Test completes without errors and the Save button (bottom, right) is activated, click the Save button. Wait a few minutes until the Adempiere Server Setup screen disappears and the deployment is finished.

Note.gif Note:

The database does not have a user adempiere or a database adempiere at this point, so these tests will not be checked. The user and database will be created in the next step.

If you are having problems, see the detailed instructions on this dialog in the pages InstallServer and ServerSetupHelp

Note.gif Note:

The setup process will have created several files in the $ADEMPIERE_HOME and $ADEMPIERE_HOME\utils directories with names like adempiere.properties, adempiereEnv.properties and myEnvironment.bat. The adempiere.properties file can be copied to a new name and a different properties file created to, for example, create a sandbox version of the database with a database name like adempiere_sandbox.

Import ADempiere Example Data

Caution.gif Caution!

The following script will DROP any existing adempiere database. Do not run this command if you already have data loaded.

Open a DOS shell.

Navigate to $ADEMPIERE_HOME\utils and type 'RUN_ImportAdempiere.bat'.

See CreateDatabase for more information.

Apply Migration Scripts

Note.gif Note:

Prior to release 3.8.0, database migrations were performed using SQL scripts. From 3.8.0 onwards, the scripts are in XML. If you are migrating from an earlier version to a version 3.8.0 or later, you will need to apply the SQL to get to the start of the XML process and then apply the XML scripts from then on. For more information, see Migration.

The database installed above will be at the state of the release version and will have all migration scripts applied. If you are migrating an existing database to a new version or applying patches, you will also need to apply migration scripts to modify the database to keep it in sync with the software.

If you are not installing patches or migrating an existing database, skip this step.

SQL - Prior to Release 3.8.0

The migration scripts can be found in the *_migra_*.zip file downloaded above. Unzip the contents to a convenient directory.

Open a DOS shell and change to the directory where you saved these scripts. The script should all have a preface number. Starting at the lowest number and ascending, for each of the *.sql files, run:

psql -f <number>.sql adempiere adempiere

You will need to enter the password adempiere each time.

If there is a tediously large number of scripts, try the following:

  1. Setup a '.pgpass' file according to the instructions for your version of PostgreSQL (for 8.4, see 30.14. The Password File). This will prevent the password entry each time you run the psql command.
  2. From a DOS shell, navigate to the directory where the scripts are located and execute this command:
    FOR %N IN (*.sql) DO psql -f %N adempiere adempiere

XML - Since Release 3.8.0

The XML migration scripts to apply should be saved in the $ADEMPIERE_HOME\migration directory. These scripts will be included in *_migra_*.zip file. Unzip the contents to $ADEMPIERE_HOME\migration.

To apply the scripts, execute the command $ADEMPIERE_HOME\utils\RUN_MigrateXML.bat from a dos shell.

Run Adempiere

Start the Application Server

Open a DOS shell Navigate to $ADEMPIERE_HOME\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 take around 2 to 3 minutes.

Note.gif Note:

Leave this DOS shell running. Later, to shut down the Application Server, you can either RUN_Server2Stop in another DOS Shell or simply close the shell.

Starting the Application Server Automatically

If you would like to run the server as a service, in a DOS shell, navigate to $ADEMPIERE_HOME\utils\windows and run Adempiere_Service_Install.bat. You will need to open the Services Window (Control Panel{{#if: Administrative Tools | →Administrative Tools }}{{#if: Services | →Services }}{{#if: | → }}) to set the properties so the service starts automatically or manually.

Launching the ADempiere Application

'Congratulations!'

At this point, your installation is complete and you can move on to Launching the ADempiere Application.

Uninstall or Revert to Previous Version

To uninstall the software, simple delete the $ADEMPIERE_HOME directory. To delete the database, use the database administrator to drop the adempiere database and user.

To revert to the previous version, delete the $ADEMPIERE_HOME directory and copy the previous version to $ADEMPIERE_HOME. Restore the backed-up copy of the database using $ADEMPIER_HOME\utils\RUN_DBRestore.bat.