Maestro can be configured to use external databases instead of the embedded database. The following sub-sections will show how to configure MSSQL external database using the user interface (the recommended method) or you can configure manually (instructions are also provided).
To use the Maestro user interface to customize Maestro for a MSSQL database, follow these steps:
Users and Builds role-hint connectors
| database section: | Search for: |
| users | <role-hint>users</role-hint> |
| builds | <role-hint>continuum</role-hint> |
Search for the <component> that contains the <role-hint> for the users and builds (Continuum) databases in the application.xml file and add the mapping shown in the code snippet below. The mapping should be put in the <otherProperties> section for the users component and/or the Continuum component.
<otherProperties>
<property>
<name>javax.jdo.option.Mapping</name>
<value>mssql</value>
</property>
<property>
<name>org.jpox.autoCreateSchema</name>
<value>true</value>
</property>
[...]
Note: You can have both the users and builds databases be external to Maestro. However, if you intend to share a database with another instance of Maestro you can only share the users database. The builds database cannot be shared, but can be external.
Take note of the warning on the page saying:
Changing the database settings will switch to the new database, not move your existing data. If the new database does not exist, you will be prompted to import data on startup. You should backup the current database before making any changes.
If you have not already done so you can backup your current database by clicking on the backup link found in the warning note. Details for the back up and restore procedures are discussed in the Backing Up the Maestro Project Server section.
Then you will have to go back to step 7 and proceed from there.
Note: Changing the database settings logs you out and restarts Maestro. It might take some time for the application to restart.
These settings are stored in the [maestro_home]/projectserver/apps/root/WEB-INF/jetty-env.xml file.
To manually configure a MSSQL database, perform the following steps:
[maestro_home]/projectserver/apps/root/WEB-INF/jetty-env.xml
Users and Builds JDBC connectors
| To edit the section that corresponds to this database: | Search for: |
| users | <New id="users" class="org.mortbay.jetty.plus.naming.Resource"> |
| continuum | <New id="continuum" class="org.mortbay.jetty.plus.naming.Resource"> |
To use a MSSQL database, edit these properties and save the file:
<New id="users" class="org.mortbay.jetty.plus.naming.Resource">
<!-- set scope to JVM -->
<Arg></Arg>
<Arg>jdbc/users</Arg>
<Arg>
<New class="com.exist.maestro.projectserver.util.SecuredDataSourceAdapter">
<Set name="dataSource">
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">net.sourceforge.jtds.jdbc.Driver</Set>
<Set name="url">jdbc:jtds:sqlserver://[database_host]:1433/[db_name];selectMethod=cursor</Set>
<Set name="username">dbuser</Set>
<Set name="password">dbpassword</Set>
</New>
</Set>
<!-- Uncomment this when using password obfuscation!
<Set name="password">OBF:obfuscatedPassword</Set> -->
</New>
</Arg>
</New>
<New id="continuum" class="org.mortbay.jetty.plus.naming.Resource">
<!-- set scope to JVM -->
<Arg></Arg>
<Arg>jdbc/continuum</Arg>
<Arg>
<New class="com.exist.maestro.projectserver.util.SecuredDataSourceAdapter">
<Set name="dataSource">
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">net.sourceforge.jtds.jdbc.Driver</Set>
<Set name="url">jdbc:jtds:sqlserver://[database_host]:1433/[db_name];selectMethod=cursor</Set>
<Set name="username">dbuser</Set>
<Set name="password">dbpassword</Set>
</New>
</Set>
<!-- Uncomment this when using password obfuscation!
<Set name="password">OBF:obfuscatedPassword</Set> -->
</New>
</Arg>
</New>
Search for the <component> that contains the <role-hint> for the users and builds (Continuum) databases in the application.xml file and add the mapping shown in the code snippet below. The mapping should be put in the <otherProperties> section for the users component and/or the Continuum component.
<otherProperties>
<property>
<name>javax.jdo.option.Mapping</name>
<value>mssql</value>
</property>
<property>
<name>org.jpox.autoCreateSchema</name>
<value>true</value>
</property>
[...]