Move the MashZone NextGen repository to PostGres

Procedure

  1. If you are using your LDAP Directory as the MashZone NextGen User Repository, make sure that at least one user in your LDAP Directory has administrator privileges for MashZone NextGen before you move the MashZone NextGen Repository. For details, see the chapter Start MashZone NextGen with an initial administrator user.

    When the MashZone NextGen User Repository is your LDAP Directory, the default administrator account (Administrator user) is disabled.

  2. If you are hosting the MashZone NextGen Repository or MashZone Repository in a new database, create the database following the official PostGreSQL documentation. Keep the following points in mind:

    Make sure this database is supported by MashZone NextGen. See Additional MashZone NextGen System and Software Requirements for details.

    If you want MashZone NextGen to support international characters in meta-data for artifacts, set the character encoding to UTF8 when you create the database. See documentation for your database for specific instructions.

    It is a best practice to require passwords for every database account that can access the MashZone NextGen Repository.

    When you initialize the PostGres database that will host the MashZone NextGen Repository, you may need to specifically set the locale used by the database to ensure case-insensitive sorting.

  3. Start the database that will become host to the MashZone NextGen Repository, if it is not already up.
  4. Copy the JAR file for the JDBC driver for your database to the following folder for each MashZone NextGen Server that uses this MashZone NextGen Repository: MashZoneNG-install/apache-tomcat/lib.
  5. Open rdsApplicationContext.xml under MashZoneNG-install/apache-tomcat/classes and add the following keys to:

    <property name="jdoProperties"> ... <map> ... <entry key="javax.jdo.mapping.Schema" value="public"/> <entry key="datanucleus.identifier.case" value="LowerCase"/> ... </map> </property>

  6. If you are using PostgreSQL version 9.x please open postgresql.conf under PostgreSQL-install/9.x/data and un-comment the following property and make sure it is set to off: standard_conforming_strings = off.
  7. Open the MashZoneNG-install/apache-tomcat/conf/context.xml configuration file in the text editor of your choice.
  8. For the MashZone NextGen Repository, edit the <Resource> element with an ID of MashzoneNextGenRepository and:
    1. Update the JDBC driver, URL and credential properties:

      name="MashzoneNextGenRepository" auth="Container" type="javax.sql.DataSource" maxTotal="200" maxIdle="30" maxWaitMillis="10000" username="app" password="app" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://host-name:port/databasename" />

    2. The JTA managed property must be false.
    3. If needed, update optional properties. See the official Tomcat Datasource Properties for a complete list of optional properties and information on defaults.

      Some common properties you may need to set include:

      validationQuery = select 1

      Common tuning properties for connections pools. See Tuning the MashZone NextGen Repository Connection Pool.

  9. Save your changes to this file.

    If the MashZone NextGen Server does not start up successfully, see Troubleshooting Connections to the MashZone NextGen Repository for suggestions.

  10. Restart the MashZone NextGen Server to apply these changes. This also restarts the MashZone Server.

    If the MashZone NextGen Server wedoes not start up successfully, see Troubleshooting Connections to the MashZone NextGen Repository for suggestions.