Setup of the PostgreSQL Database Backend

Creating the database

Create a database named nag_db (or something else) and a PG user account that has write access to the given database (please consult the PG documentation for a description of the necessary steps).

Creating the database scheme

Once the database is created, it has to be populated using the a couple of sql-scripts that are provided with the Naggregator PG-Bound EAR File. Open the EAR file and locate directory naggregator.ear/storage/postgresql/sql/1.3 and feed the contained files into the database in the following order. You can omit the stated 'testdata' files to avoid the creation of testdata including a project user account named test_user (password test_user).

  1. create-scheme-nag-user.sql
  2. create-scheme-nag-project.sql
  3. create-scheme-nag-ticket.sql
  4. create-scheme-nag-accounting.sql
  5. create-coredata-nag-user.sql
  6. create-coredata-nag-project.sql
  7. create-coredata-nag-ticket.sql
  8. create-coredata-nag-accounting.sql
  9. create-testdata-nag-user.sql
  10. create-testdata-nag-project.sql
  11. create-testdata-nag-ticket.sql
  12. create-testdata-nag-accounting.sql

Updating the schema to version 1.4

If you are running a version 1.3 Naggregator installation or setting up a new installation, you have to upgrade the 1.3 database schema to version 1.4.

You can find the necessary upgrade scripts in naggregator.ear/storage/postgresql/sql/1.4; please execute the scripts in the following order:

  1. upgrade-scheme-nag-system.sql
  2. upgrade-scheme-nag-user.sql
  3. upgrade-scheme-nag-project.sql
  4. upgrade-scheme-nag-ticket.sql
  5. upgrade-scheme-nag-notification.sql
  6. upgrade-scheme-nag-synchronization.sql
  7. upgrade-scheme-nag-accounting.sql

Security of the administration account

The sql scripts issue the creation of a administrative user account (admin). This accounts is accessible by default using the password admin; for the sake of security the account password and mail address should be customized upon installation!

Announce the database to Naggregator

Open naggregator.ear/nag-storage-postgresql-VERSION.sar/META-INF/datasource-ds.xml, declare the database URL and credentials:

<datasources>
        <local-tx-datasource>
                <jndi-name>NaggregatorDS</jndi-name>
                <connection-url>jdbc:postgresql://localhost:5432/nag_db</connection-url>
                <driver-class>org.postgresql.Driver</driver-class>
                <user-name>the_user</user-name>
                <password>the_password</password>
        </local-tx-datasource>
</datasources>