Detailed steps for JIRA to connect to PostgreSQL database

This article mainly introduces how to connect JIRA to PostgreSQL database.

first

  • Check if your PostgreSQL version is supported. See Supported Platforms .
  • If you are transferring JIRA to another server, export the data as an XML backup first, and then transfer the data from the old database to the new database.
  • Close JIRA before starting unless you are running the Setup Wizard.

1. Create and configure the PostgreSQL database

  1. Create a database user (login role) to connect with JIRA eg: jiradbuser .
  2. Create a database for storing JIRA issues using Unicode collation, like: jiradb .
    CREATE DATABASE jiradb WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
    or via the command line:
    $ createdb -E UNICODE -l C -T template0 jiradb
  3. Make sure the user has permissions to connect to the database and create and edit tables.

2. Copy the PostgreSQL JDBC driver to your application server (JIRA WAR only)

(warning)Skip this step if you have a JIRA 'Recommended' distribution that includes the PostgreSQL JDBC driver installed. The JIRA WAR distribution does not contain this driver.

  1. Download the PostgreSQL JDBC driver from http://jdbc.postgresql.org/download.html .
  2. Add the PostgreSQL JDBC driver jar to the lib/ directory of the application server.

3. Configure the JIRA server to connect to the PostgreSQL database

There are three ways to configure a JIRA server to link to a PostgreSQL database:

  • Using the JIRA installation wizard (not available for JIRA WAR) - if you have already installed JIRA and are setting it up for the first time, the settings will be saved to the dbconfig.xml file in the JIRA home directory.
  • Using the JIRA configuration tool (not available for JIRA WAR) - if there is an existing JIRA instance, the settings will be saved to the dbconfig.xml file in the JIRA home directory.
  • Manual configuration - use this method to link to the JIRA server only if you have a JIRA WAR instance or console. The dbconfig.xml file in the JIRA home directory needs to be updated manually.

Description of each configuration method:

JIRA setup wizard The JIRA setup wizard is only displayed when you first access JIRA on your browser.
  1. Set the Database Connection to My own database in the 'Configure Language and Database' of the initial page.
  2. Set the Database Type to PostgreSQL.
  3. Fill in the fields as described in the Database Connection Fields section below.
  4. Test the connection and save.
JIRA configuration tool
  1. Run the JIRA configuration tool as follows:
    • Windows: Open a command prompt and run the file config.bat in the bin subdirectory of the JIRA installation directory.
    • Linux/Unix: Open the console and run the config.sh file in the bin subdirectory of the JIRA installation directory.
    (info)There may be a failure error, refer to this article for solutions.
  2. Navigate to the Database tab and set the Database type to PostgreSQL.
  3. Fill in the fields as described below for the database connection fields.
  4. Test the connection and save.
  5. JIRA.
Manually
  1. Find the dbconfig.xml file at the root of the JIRA home directory.
    • If the file does not exist, create it, copy and paste the XML sample code (below) into the file.
  2. Update the file according to the database connection field description below. Escape all '&' characters by adding 'amp;' at each end.
    • Note: The <database-type/> element must specify the database type. Example: If you are using PostgreSQL 9.2. If you start JIRA without specifying the database type, the database tables will not be created correctly. If you encounter similar problems, see Specifying an Incorrect Database Type to resolve.
  3. Save the file and restart JIRA.


Database connection fields:

setup wizard/configuration tool dbconfig.xml describe
Hostname Located in the <url> tag (eg bold text below):
<url>jdbc:postgresql:// dbserver :5432/jiradb</url>
The machine name or IP address where the PostgreSQL server is installed.
Port Located in the <url> tag (eg bold text below):
<url>jdbc:postgresql://dbserver: 5432 /jiradb</url>
The TCP/IP port on which the PostgreSQL server is listening. Can also be left blank to use the default port.
Database Located in the <url> tag (eg bold text below):
<url>jdbc:postgresql://dbserver:5432/ jiradb </url>
The name of the PostgreSQL database (where the JIRA data will be saved). It should be created in the first step above.
Username 位于< username>标记(例如下面的粗体字):
< username>jiradbuser< /username>
JIRA用于连接PostgreSQL服务器的用户。应在上面第一步时创建。
Password 位于< password>标记(例如下面的粗体字):
< password>jiradbuser< /password>
用于与PostgreSQL服务器身份验证的用户密码。
Schema 位于< schema-name>标记(例如下面的粗体字):
< schema-name>public< /schema-name>
PostgreSQL数据库使用的模式名称。
PostgreSQL 7.2及以后的版本要求在<schema-name/>中指定模式。如果你的PostgreSQL使用默认'public'模式,这需要在<schema-name/>元素中指定。
确保你的数据库模式名称是小写,因为JIRA不支持PostgreSQL数据库中的模式名称包含大写字符。


dbconfig.xml文件示例

JIRA-xml text

4.启动JIRA

现在JIRA连接到PostgreSQL数据库就配置好了。下一步就是启动JIRA。

  • 如果正在使用JIRA的'recommended'分配,启动它,并观察日志中是否存在错误。
  • 如果使用的是JIRA WAR分配,重建并重新部署在应用服务器的Web应用程序。

 Click to view>> More JIRA Chinese tutorials

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326336108&siteId=291194637