Adempiere Install for Windows & PostgreSQL
From ADempiere ERP Wiki
This install process applies to Windows XP/Vista operating systems and the PostgreSQL database.
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.
Before you begin, download each of the following packages:
- Java SE Development Kit - Get the latest from 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.
- ADempiere Latest Release - Download the latest Adempiere from http://sourceforge.net/projects/adempiere/files/ADempiere Official Release.
- ADempiere Patches - From 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.
Install the Pre-Requisites
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.
There may well be a number of JDK and JRE directories, so choose the right ones! The JDK should include the JRE.
Set the JAVA Environment Variables
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.)
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 ";"
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.
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.
- 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)
- 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
Install the ADempiere Software
There is no install script. Just extract the Adempiere zip file to <drive letter>:\ (e.g. c:\).
Apply the Patches
Patches are a combination of *.jar files, which replace *.jar files in the C:\ADempiere\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 C:\Adempiere\lib\patches.jar, overwriting the existing file. See the detailed instructions in Patches Installation.
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 C:\Adempiere\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 C:\adempiere 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
- 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 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.
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.
Import ADempiere Example Data
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 C:\Adempiere\utils and type 'RUN_ImportAdempiere.bat'
As of Release 3.8.0, the RUN_ImportAdempiere script with also load and apply any xml migration scripts found in the c:\adempiere\migrations directory.
See CreateDatabase for more information.
Apply Migration Scripts
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:
- 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.
- 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 c:\adempiere\migrations directory. These scripts will be included in *_migra_*.zip file. Unzip the contents to c:\adempiere\migrations.
To apply the scripts, execute the command c:\adempiere\utils\RUN_Migrate.bat from a dos shell.
Start the Application Server
Open a DOS shell 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 take around 2 to 3 minutes.
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 C:\Adempiere\utils\windows and run Adempiere_Service_Install.bat. You will need to open the Services Window (Control Panel→Administrative Tools→Services) to set the properties so the service starts automatically or manually.
At this point, your installation is complete and you can move on to Launching the ADempiere Application.