Documentation for JIRA 4.2. Documentation for other versions of JIRA is available too. 
![]()
These instructions will help you connect JIRA to a PostgreSQL 8.2+ database.
Note: A version of these instructions specific to Linux and JIRA Standalone is available.
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.
jirauser).jiradb) with Unicode collation
CREATE DATABASE jiradb WITH ENCODING 'UNICODE';
$ createdb -E UNICODE jiradb
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.
The JIRA Configuration Tool requires that Java be installed and configured on your operating system. We recommend using a Java platform supported by JIRA — refer to JIRA Requirements for details.
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).
conf/server.xml (if you are using JIRA Standalone) and customise the username, password, driverClassName and url parameters for the Datasource. (If you are using JIRA WAR/EAR, edit the appropriate file on your application server; e.g. for Tomcat, edit conf/Catalina/localhost/jira.xml).
<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="org.postgresql.Driver"
url="jdbc:postgresql://host:port/database" [see also http://jdbc.postgresql.org/doc.html ]
[ 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>
(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/ .)
conf/server.xml, and delete the minEvictableIdleTimeMillis and timeBetweenEvictionRunsMillis attributes (which are only needed for HSQL, and degrade performance otherwise).atlassian-jira/WEB-INF/classes/entityengine.xml (if you are using JIRA Standalone) or edit-webapp/WEB-INF/classes/entityengine.xml (JIRA WAR/EAR), and change the field-type-name attribute to the value for your database, as shown below. (If you forget to do this and start JIRA, it may create database tables incorrectly. See this page if this happens to you.)<datasource name="defaultDS" field-type-name="postgres72" schema-name="public" helper-class="org.ofbiz.core.entity.GenericHelperDAO" check-on-start="true" use-foreign-keys="false" use-foreign-key-indices="false" check-fks-on-start="false" check-fk-indices-on-start="false" add-missing-on-start="true" check-indices-on-start="true">
PostgreSQL 7.2 and above require a schema to be specified. The default schema in PostgreSQL is public. If you are working with JIRA Standalone, be sure to change schema-name from PUBLIC to public (lowercase).
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. If you are using JIRA Standalone, start it up and watch the logs for any errors. If you are using the JIRA WAR/EAR distribution, rebuild and redeploy the webapp in your application server.
Please see JIRA and PostgreSQL.