JSS using an external Database

A default JSS installation uses a local MySQL database on the Mac OS X Server running the JSS servlet. In production environments you probably want to move the database to a dedicated database server or cluster.

Dumping the local JSS database
The default JSS installation uses well known credentials. For security reasons the following example uses the placeholder $JSSDB_NAME, $JSSDB_USER, and $JSSDB_PASSWORD instead. Please find the required information in the  configuration file.

To dump the database to a file named  use the   command. Open Terminal and type: mysqldump --comments --single-transaction \ --user=$JSSDB_USER --password=$JSSDB_PASSWORD \ $JSSDB_NAME > JSS-`hostname -f`-`date +%Y%m%d-%H%M%S`.sql You probably want to extend the file name by a path to folder with sufficient free space for the MySQL dump. Please note the -symbol depicts line-breaks.

Configuration files
There are three configuration files within the Tomcat folder (/Library/Tomcat) which refer to the JSS database:
 * identical to

The file  defines to JDBC data sources for the JSS servlet. The file is identical to  (in case you deployed the JSS to the default webapps ROOT folder). You probably do not want to maintain to copies of the same file so create a symlink from one to another. Simply replace $DB_USER, $DB_PASSWORD, $DB_HOST, $DB_PORT (default 3306), and $DB_NAME with the correct values for your external data source.

  <Resource auth="Container" name="jdbc/JAMFDataSource" user="$DB_USER" password="$DB_PASSWORD" driverClass="com.mysql.jdbc.Driver" factory="org.apache.naming.factory.BeanFactory" type="com.mchange.v2.c3p0.ComboPooledDataSource" jdbcUrl="jdbc:mysql://$DB_HOST:$DB_PORT/$DB_NAME" initialPoolSize="5" minPoolSize="5" maxPoolSize="60" acquireIncrement="5" maxIdleTimeExcessConnections="30" idleConnectionTestPeriod="300" numHelperThreads="5" connectionCustomizerClassName="com.jamfsoftware.jdbc.JamfMySqlConnectionCustomizer" />  <Resource auth="Container" name="jdbc/JAMFPriorityDataSource" user="$DB_USER" password="$DB_PASSWORD" driverClass="com.mysql.jdbc.Driver" factory="org.apache.naming.factory.BeanFactory" type="com.mchange.v2.c3p0.ComboPooledDataSource" jdbcUrl="jdbc:mysql://$DB_HOST:$DB_PORT/$DB_NAME" initialPoolSize="5" minPoolSize="5" maxPoolSize="30" acquireIncrement="5" maxIdleTimeExcessConnections="30" idleConnectionTestPeriod="300" numHelperThreads="3" connectionCustomizerClassName="com.jamfsoftware.jdbc.JamfMySqlConnectionCustomizer" />  The third configuration file  has a different format. Please replace the required fields in the  section as below:  $DB_USER $DB_PASSWORD $DB_NAME com.mysql.jdbc.Driver true 2 <QueryTimeout>0</QueryTimeout> <jdbcCompliantTruncation>false</jdbcCompliantTruncation> <ServerName>$DB_SERVER</ServerName> <ServerPort>$DB_PORT</ServerPort> <DataBaseType>mysql</DataBaseType> <JNDIDataSourceName>jdbc/JAMFDataSource</JNDIDataSourceName> <JNDIPriorityDataSourceName>jdbc/JAMFPriorityDataSource</JNDIPriorityDataSourceName> </DataBase>

Unfortunately JAMF only distributes the JSS servlet as web application resources (.war) including those configuration files. Please ensure you have a backup of your latest configuration before (re)deploying an official WAR file.