This configuration is most ideal if you have already added data to the default HypersonicSQL in-process database that is included with a standard GridPort installation and don't want to migrate the data to another database server. It takes advantage of the fact that both 'In-Process' and 'Server' modes of HypersonicSQL use the same database directory structure, which makes migration simple.
First, you will need access to the hsqldb-version.jar file. This file can be found in the $CATALINA_HOME/webapps/gpir/WEB-INF/lib directory inside your gpir webapp You will need to specify the location of this file in a later step (NOTE: You do not need to copy it anywhere).
It is recommended that you copy the current GPIR database located in $CATALINA_HOME/webapps/gpir/WEB-INF/db to another appropriate location outside of the gpir webapp. This will prevent the database from being overwritten or deleted if at any point you need to upgrade GPIR. Once you've copied the directory, check to see that there's not a gpir.lck file present and if there is, remove it.
Use the following single command to start the database server (NOTE: the command spans two lines here so that it will fit):
localhost> java -cp [path to hsqldb.jar] org.hsqldb.Server -database.0 \
[path to database dir]/gpir -dbname.0 gpir
You will also need to modify the db.url property in the project.properties file in the GPIR source directory.
db.url=jdbc:hsqldb:hsql://localhost:9001/gpir
maven install
Assuming you have installed and configured PostgreSQL database according to the documentation at http://www.postgresql.org you will need to configure GPIR to use it as its data source. Open the project.properties file in the GPIR source directory in your favorite editor. We have provided you with a boilerplate PostgreSQL configuration that you can customize for your own configuration. First, comment out the HypersonicSQL configuration and uncomment the PostgreSQL configuration.
# Hypersonic SQL
#db.type=hypersonicsql
#db.driver=org.hsqldb.jdbcDriver
#db.url=jdbc:hsqldb:file:${env.CATALINA_HOME}/webapps/gpir/WEB-INF/db/gpir
#db.username=sa
#db.password=
#hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect
# PostgreSQL
db.type=postgresql
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/GPIR
db.username=
db.password=
hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect
Deploy GPIR making sure that you specify the -Dinitdb=true argument to initialize the database (NOTE: this assumes a clean installation of PostgreSQL that doesn't already have a GPIR database initialized).
maven install -Dinitdb=true