Documentation for JIRA 4.1. Documentation for other versions of JIRA is available too.
These instructions will help you connect JIRA to a Microsoft SQL Server 2005 database.
Note
On this page:
If you are already using JIRA, create an export of your data as an XML backup. You will then be able to transfer data from your old database to your new database, as described in Switching databases.
jiradb
).jirauser
). Note that jirauser
should not be the database owner, but should be in the db_owner
role. (See SQL Startup Errors for details.)jiraschema
) for the JIRA tables. Please note that a 'schema' in SQL Server 2005 is a distinct namespace used to contain objects, and is different from a traditional database schema. You are not required to create any of JIRA's tables, fields or relationships (JIRA will create these objects in your empty schema when it starts for the first time). You can read more on SQL Server 2005 schemas in the relevant Microsoft documentation.If you are having difficulties setting up your JIRA database for SQL Server, additional information is available in the Setting up your JIRA database for MS SQL Server 2005 document.
Skip this step if you are using JIRA Standalone, as JIRA Standalone includes the driver.
lib/
directory.
The JIRA Configuration Tool is a GUI tool only available if you are using JIRA Standalone distribution. If you are running a WAR-EAR distribution of JIRA, or have a text-only connection to the JIRA server, you will need to configure the files manually.
config.bat
in the bin
subdirectory of the JIRA Installation Directory.config.sh
in the bin
subdirectory of the JIRA Installation Directory.The Configuration Tool will display your current configuration settings if any are already set.
Please Note: You may need to set the JAVA_HOME
environment variable to run the JIRA Configuration Tool. See Installing Java for details.
Congratulations — you have finished!
Skip this step if you used the JIRA Configuration Tool (see above).
username
, password
, driverClassName
and url
parameters for the Datasource, as shown in the code sample below.
conf/server.xml
.conf/Catalina/localhost/jira.xml
. (Note: if you can't find this section at all, you've probably got the wrong file — search for mentions of 'jira' in the files under conf/
.)<Server port="8005" shutdown="SHUTDOWN"> <Service name="Catalina"> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <Engine name="Catalina" defaultHost="localhost"> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false"> <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource" username="[enter db username]" password="[enter db password]" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://localhost:1433/jiradb" [ delete the minEvictableIdleTimeMillis and timeBetweenEvictionRunsMillis params here ] /> <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/> <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/> </Context> </Host> </Engine> </Service> </Server>
If you are using JIRA Standalone, you will also need to edit conf/server.xml
, and delete the minEvictableIdleTimeMillis
and timeBetweenEvictionRunsMillis
attributes. These attributes are only needed for HSQL, and will degrade performance if they are not removed.
In the example above, jiradb is the connection name. You may also have an instance name such that the connection string is jdbc:jtds:sqlserver://localhost:1433/jiradb.
field-type-name
attribute to mssql
.
atlassian-jira/WEB-INF/classes/entityengine.xml
.edit-webapp/WEB-INF/classes/entityengine.xml
. If you forget to do to make this change and start JIRA, it may create database tables incorrectly. See this page if this happens to you.schema-name="PUBLIC"
to the name of the schema associated with the database (i.e. the schema you created in step 1.3 above), e.g. schema-name="jiraschema"
. Note that the schema must exist in the database before you perform this step.<!-- DATASOURCE - You will need to update this tag for your installation. --> <datasource name="defaultDS" field-type-name="mssql" schema-name="jiraschema" helper-class="org.ofbiz.core.entity.GenericHelperDAO" check-on-start="true" use-foreign-keys="false" ...
If you are using JIRA WAR/EAR, your application server may require other changes to entityengine.xml
(e.g. to customise the jndi-jdbc
tag).
You should now have an application server configured to connect to a database, and JIRA configured to use the correct database type. The next step is to start it up!
Have experiences to share with SQL Server and JIRA? We welcome your thoughts. Please see the user-contributed MS SQL Server notes.