Simplest Enterprise Continuous Integration Solutions
Showing posts with label JIRA. Show all posts
Showing posts with label JIRA. Show all posts

Saturday, October 11, 2014

JIRA REST API: query JIRA issue summary

Enable JIRA to accept remote API calls:

Enable Accept remote API calls (Administrator > General Configuration > Set Accept remote API calls to On)

Examples for http and https with summary field display

curl -s -u <jira-user>:<jira-password> -X GET -H "Content-Type: application/json" http://<jira-server>:9090/rest/api/2/search?jql=key=<jira-key>&fields=summary


curl -sk -u <jira-user>:<jira-password> -X GET -H "Content-Type: application/json" http://<jira-server>:8443/rest/api/2/search?jql=key=<jira-key>&fields=summary

Sunday, June 3, 2012

JIRA upgrade: JIRA 4.4.4 to JIRA 5.0.6

Upgrade JIRA 4.4.4 (32bit) to 5.0.6 steps:


1. Backup JIRA 4.4.4 installation

Administration -> System -> Import & Export -> Backup System -> Backup JIRA data
[jira@linux64-jira-server ~]$  id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
# Backup /opt/atlassian for JIRA 4.4.4 32bit installation
[jira@linux64-jira-server ~]$ cp -rfp /opt/atlassian /opt/backup_atlassian_4.4.4


2. Upgrade to JIRA 5.0.6

[jira@linux64-jira-server ~]$ chmod a+x /tmp/atlassian-jira-5.0.6-x32.bin
[jira@linux64-jira-server ~]$ /tmp/atlassian-jira-5.0.6-x32.bin
Unpacking JRE ...
Starting Installer ...
This will install JIRA 5.0.6 on your computer.
OK [o, Enter], Cancel [c]
o
Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2], Upgrade an existing JIRA installation [3, Enter]
3
Existing installation directory:
[/opt/atlassian/jira]
Back Up JIRA Home Directory
The upgrade process will automatically back up your JIRA Installation
Directory. You can also choose to back up your existing JIRA Home Directory.
Both directories are backed up as zip archive files in their respective
parent directory locations.
We strongly recommend choosing this option in the unlikely event that you
experience problems with the upgrade and may require these backups to
restore your existing JIRA installation.
If you have many attachments in your JIRA Home Directory, the zip archive of
this directory may consume a significant amount of disk space.
Back up JIRA home directory?
Yes [y, Enter], No [n]
y
Checking for local modifications.
List of modifications made within JIRA directories.
The following provides a list of file modifications within the
atlassian-jira directory.
Modified files:
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuecommentedited.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuecommented.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueresolved.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuedeleted.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuereopened.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueclosed.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueworklogdeleted.vm
        atlassian-jira/WEB-INF/classes/templates/jira/issue/field/description-edit.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueworkstopped.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueupdated.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuecreated.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueworklogupdated.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueworkstarted.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueworklogged.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuegenericevent.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issueassigned.vm
        atlassian-jira/WEB-INF/classes/templates/email/subject/issuemoved.vm
Removed files:
        (none)
[Enter]
Added files:
        atlassian-jira/images/hello.html
        atlassian-jira/WEB-INF/classes/subversion-jira-plugin.properties
        atlassian-jira/WEB-INF/lib/atlassian-jira-subversion-plugin-0.10.7.jar
[Enter]
        atlassian-jira/WEB-INF/lib/trilead-ssh2-build213-svnkit-1.3-patch.jar
        atlassian-jira/WEB-INF/lib/svnkit-1.3.3.jar
[Enter]
Checking if your instance of JIRA is running
Upgrade Check List
Back up your external database
We strongly recommend you back up your JIRA database if you have not already
done so.
Please refer to the following URL for back up guidelines:
http://docs.atlassian.com/jira/docs-050/Backing-Up-Data
Check plugin compatibility
Check that your non-bundled plugins are compatible with JIRA 5.0.6.
Access the plugin manager through the following URL:
http://localhost:8080/plugins/servlet/upm#compatibility
For more information see our documentation at the following URL:
http://docs.atlassian.com/jira/docs-050/Upgrading+JIRA#UpgradingJIRA-upgradechecklist
Please ensure you have read the above checklist before upgrading.
Your existing JIRA installation is about to be upgraded!
The upgrade process will shut down your existing JIRA installation to complete the upgrade.
Do you want to proceed?
Upgrade [u, Enter], Exit [e]
u
Your instance of JIRA is currently being upgraded.
Shutting down JIRA...
Checking if JIRA has been shutdown...
Backing up the JIRA installation directory
Backing up the JIRA home directory
Deleting the previous JIRA installation directory...
Extracting files ...
Please wait a few moments while JIRA starts up.
Launching JIRA ...
Installation of JIRA 5.0.6 is complete
Your installation of JIRA 5.0.6 is now ready and can be accessed via your
browser.
Custom modifications
Your previous JIRA installation contains customisations that must be
manually transferred. Refer to our documentation more information:
http://docs.atlassian.com/jira/docs-050/Upgrading+JIRA#UpgradingJIRA-custommodifications
JIRA 5.0.6 can be accessed at http://localhost:8080
JIRA 5.0.6 may take several minutes to load on first start up.
Finishing installation ...


3. Sync with previous modified files

[jira@linux64-jira-server ~]$ cd /opt/atlassian/jira
[jira@linux64-jira-server ~]$ cd atlassian-jira/WEB-INF/classes/templates/jira/issue/field/
[jira@linux64-jira-server ~]$ mv description-edit.vm org_bk_description-edit.vm
[jira@linux64-jira-server ~]$ cp /opt/backup_atlassian_4.4.4/jira/atlassian-jira/WEB-INF/classes/templates/jira/issue/field/description-edit.vm .
[jira@linux64-jira-server ~]$ cd /opt/atlassian/jira
[jira@linux64-jira-server ~]$ cd atlassian-jira/WEB-INF/classes/templates/email
[jira@linux64-jira-server ~]$ mv subject org_bk_subject
[jira@linux64-jira-server ~]$ cp -rp /opt/backup_atlassian_4.4.4/jira/atlassian-jira/WEB-INF/classes/templates/email/subject .


4. Start JIRA 5.0.6

[jira@linux64-jira-server ~]$ service jira stop
[jira@linux64-jira-server ~]$ service jira start


5. Update JIRA plugins through JIRA web

update JIRA suite utilities
enable behaviour
re install subversion

Saturday, March 31, 2012

MySQL: Convert MySQL DB characte set latin1 to utf8

Steps for converting JIRA MySQL DB character set latin1 to utf8:

JIRA's XML backup utility to backup JIRA database in XML format

Administration -> System -> Import & Export -> Backup System -> Backup JIRA data


# develop a Perl script (mysql_latin1_2_utf8.pl) to use ALTER TABLE/DATABASE SQL statements to convert data from latin1 to utf8

# automatically convert all text columns to utf8

ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8;

# for any future tables created in this database will use utf8 by default

ALTER DATABASE <database_name> CHARACTER SET utf8;

# mysql_latin1_2_utf8.pl usage

NAME
       mysql_latin1_2_utf8.pl
SYNOPSIS
       DESCRIPTION

       This script is going to convert MySQL database characte set from latin1 to utf8.
       VERSION
       Version 1.0
       USAGE
          perl mysql_latin1_2_utf8.pl --mysql_dbname "[mysql_dbname]" --mysql_username "[mysql_username]" --mysql_password "[mysql_password]" --mysql_host "[mysql_host]"
       ·   --mysql_dbname "[mysql_dbname]" - MySQL dbname. Required
       ·   --mysql_username "[mysql_username]" - MySQL username. Required
       ·   --mysql_password "[mysql_password]" - MySQL password. Option
       ·   --mysql_host "[mysql_host]" - MySQL host. Required
       EXAMPLE
          1. convert MySQL database characte set from latin1 to utf8.
          perl /tmp/mysql_latin1_2_utf8.pl --mysql_dbname "latin1jiradb" --mysql_username "root" --mysql_password "********" --mysql_host "linux64-jira-server"

# stop jira service

[root@linux64-jira-server ~]# service jira stop

# execute MySQL utf8 convertion

[root@linux64-jira-server ~]# perl /tmp/mysql_latin1_2_utf8.pl --mysql_dbname "latin1jiradb" --mysql_username "root" --mysql_password "********" --mysql_host "linux64-jira-server"

# restart mysql service

[root@linux64-jira-server ~]# service mysql restart

# start jira service

[root@linux64-jira-server ~]# service jira start

Sunday, March 11, 2012

JIRA: cascading select fields

Open Internet Explorer with JIRA admin login


"%ProgramFiles%\Internet Explorer\iexplore.exe"
"http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=<fieldConfigId>&selectedParentOptionId=&addSelectValue=true&addValue=<Parent_Value>"


"%ProgramFiles%\Internet Explorer\iexplore.exe"
"http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=<fieldConfigId>&selectedParentOptionId=<selectedParentOptionId>&addSelectValue=true&addValue=<Child_Value>"


To find those IDs, click 'Configure' on the custom field, then 'Edit Options' to get to the EditCustomFieldOptions!default.jspa page. The URL will have a fieldConfigId parameter, and its value is what you enter here.
On the EditCustomFieldOptions page, add a value, then click 'Delete' alongside it and examine the URL, which will be EditCustomFieldOptions!remove.jspa?fieldConfigId=...&selectedValue=..., The 'selectedValue' is what to enter here.

"%ProgramFiles%\Internet Explorer\iexplore.exe" "http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=10704&selectedParentOptionId=&addSelectValue=true&addValue=third"

"%ProgramFiles%\Internet Explorer\iexplore.exe" "http://<my_jira_server>:8080/secure/admin/EditCustomFieldOptions!add.jspa?fieldConfigId=10704&selectedParentOptionId=11619&addSelectValue=true&addValue=second"


Saturday, February 18, 2012

JIRA security: Anonymous user access

Make sure JIRA Anonymous user has read only access

1. JIRA: Administration -> Issues -> Permission Schemes -> bla bla Schemes -> Permissions -> Browse Projects, Add -> Group (Anyone)
2. Within JIRA project associated Workflow:
All of Transitions has conditions: Only users in group jira-users can execute this transition
3. without login into JIRA, browsing http://<MY_JIRA_SERVER>:8080/browse/<MY_JIRA_PROJECT_KEY>-123 will see below Login button

Saturday, February 11, 2012

JIRA migration: BugZilla multi-line desc/comments

BugZilla MySQL database

The longtext table contains each bug_id's associated multi-line desc and multi-line comments.


MySQL query to get bug_id and the text result

SELECT 

    bug_id
    , thetext
FROM
    bugs.longdescs as T1
where
    T1.bug_id in (SELECT 
           bug_id
        FROM
            bugs.bugs
        where
            product_id in (SELECT 
                    id
                FROM
                    bugs.products
                where
                    (name like 'MY_BUGZILLA_PROJECT')))
Order by T1.bug_id
For each of bug_ids associated multi-line thetext entries: 
First entry is the bug_id associated desc
Remaining entries (if existed) are the bug_id associated comments.


Migrate BugZilla multi-line desc & comments into JIRA

1. create a BugZilla query for JIRA migration without multi-line desc/comments
2. JIRA, Administration -> System -> Import & Export -> Import External projects -> CSV Import
3. create a MySQL query to only contains bug ids, and save the query result as XML format

SELECT 
    bug_id
FROM
    bugs.bugs
where
    product_id in (SELECT 
            id
        FROM
            bugs.products
        where
            (name like ' MY_BUGZILLA_PROJECT ')))
Order by bug_id
4. run a PERL script (i.e. xmlBugIdExportIntoJIRA.pl) through JIRA cli interface updating desc/comments on Linux platform from where BugZilla's desc/comments UTF-8 code issue will be solved)

NAME

    xmlBugIdExportIntoJira.pl

SYNOPSIS

  DESCRIPTION

    This script is going to migrate exported XML format from BugZilla MySQL with bug_id, thetext file into Jira.

  VERSION

    Version 1.0

  USAGE

       perl xmlBugIdExportIntoJira.pl --jira_project_key "[jira_project_key]" --jira_field_for_bug_id "[jira_field_for_bug_id]" --jira_field_for_bugzilla_thetext "[jira_field_for_bugzilla_thetext]" --exported_xml_format_bugzilla_mysql_id_description_file "[exported_xml_format_bugzilla_mysql_id_description_file]" --jira_cli "[jira_cli]"
    *   --jira_project_key "[jira_project_key]" - Jira Project Key. *Required*
    *   --jira_field_for_bug_id "[jira_field_for_bug_id]" - Jira field maps to bug_id field. *Required*
    *   --jira_field_for_bugzilla_thetext="[jira_field_for_bugzilla_thetext]" - Jira field maps to bug_id Description field. *Required*
    *   --exported_xml_format_bugzilla_mysql_id_description_file "[exported_xml_format_bugzilla_mysql_id_description_file]" - Fullpath of exported xml format BugZilla MySQL bug_id file. *Required*
    *   execute MySQL query SELECT bug_id FROM bugs.bugs where product_id=(SELECT id FROM bugs.products where name = "MY_BUGZILLA_PROJECT" and save the results into xml
        SELECT bug_id, thetext FROM bugs.longdescs as T1 where T1.bug_id = id Order By bug_when
    *   --jira_cli "[jira_cli]" - Full path of atlassian-cli. *Required*

  EXAMPLE

       1. Migrate exported XML format BugZilla bug_id, thetext file into Jira.
       perl /tmp/xmlBugIdExportIntoJira.pl --jira_project_key "MY_JIRA_PROJECT_KEY" --jira_field_for_bug_id "bug_id" --jira_field_for_bugzilla_thetext "description" --exported_xml_format_bugzilla_mysql_id_description_file /tmp/BugZilla_MySQL_id_longdescs.xml --jira_cli /opt/atlassian-cli-2.4.0/jira.sh

Sunday, January 29, 2012

JIRA migration: ClearQuest multi-line description

Migrate ClearQuest defects multi-line description field into JIRA

1. Using ClearQuest client or ClearQuest web to create a ClearQuest query for those ClearQuest defects without desc field
2. From ClearQuest web exporting ClearQuest query results into excel format, and save as a csv file
3. JIRA, Administration -> System -> Import & Export -> Import External projects -> CSV Import
4. Duplicate the above ClearQuest query, and only display id and description fields
5. From ClearQuest Eclispe Client exporting ClearQuest query results as XML format

Use ClearQuest Client the one built on Eclipse

Within Eclipse ClearQuest Client workspace, select a query, which contains the display fields: id and multiline field (such as, Description),right click the query -> select Export Records… -> in Select fields diagram, click Next -> in Export tool settings diagram, select XML as Format, click Next -> in Specify file names diagram, click Finish
6. Run a PERL script (i.e. xmlClearQuestExportIntoJira.pl) through JIRA cli interface updating desc on Linux from where ClearQuest UTF-8 code issue will be eliminated)


NAME

    xmlClearQuestExportIntoJira.pl

SYNOPSIS

  DESCRIPTION

    This script is going to migrate exported XML format ClearQuest id, Description file into Jira.

  VERSION

    Version 1.0

  USAGE

       perl xmlClearQuestExportIntoJira.pl --jira_project_key "[jira_project_key]" --jira_field_for_clearquest_id "[jira_field_for_clearquest_id]" --jira_field_for_clearquest_description "[jira_field_for_clearquest_description]" --exported_xml_format_clearquest_id_description_file "[exported_xml_format_clearquest_id_description_file]" --jira_cli "[jira_cli]"
    *   --jira_project_key "[jira_project_key]" - Jira Project Key. *Required*
    *   --jira_field_for_clearquest_id "[jira_field_for_clearquest_id]" - Jira field maps to ClearQuest id field. *Required*
    *   --jira_field_for_clearquest_description "[jira_field_for_clearquest_description]" - Jira field maps to ClearQuest Description field. *Required*
    *   --exported_xml_format_clearquest_id_description_file "[exported_xml_format_clearquest_id_description_file]" - Full path of exported xml format ClearQuest id, Description file. *Required*
    *   --jira_cli "[jira_cli]" - Full path of atlassian-cli. *Required*

  EXAMPLE

       1. Migrate exported XML format ClearQuest id, Description file into Jira.
       perl /tmp/xmlClearQuestExportIntoJira.pl --jira_project_key "MY_JIRA_PROJECT_KEY" --jira_field_for_clearquest_id "id" --jira_field_for_clearquest_description "description" --exported_xml_format_clearquest_id_description_file /tmp/CQ_desciption_export.xml --jira_cli /opt/atlassian-cli-2.4.0/jira.sh

Saturday, January 21, 2012

JIRA security: JIRA server runs over HTTPS

In order to encrypt JIRA login username & passsword instead of plain text in HTTP, configure JIRA Tomcat server (6.0) to run over HTTPS


1. Generate a private key

# login as root on JIRA Linux server.
[root@linux64-jira-server ~]#  id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
# su to jira running user
[jira@linux64-jira-server ~]$ su - jira
[jira@linux64-jira-server ~]$ $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  linux64-jira-server.domain.com
What is the name of your organizational unit?
  [Unknown]:  my_unit
What is the name of your organization?
  [Unknown]:  my_org
What is the name of your City or Locality?
  [Unknown]:  my_city
What is the name of your State or Province?
  [Unknown]:  my_state
What is the two-letter country code for this unit?
  [Unknown]:  my_country
Is CN=linux64-jira-server.domain.com, OU=my_unit, O=my_org, L=my_city, ST=my_state, C=my_country correct?
  [no]:  y
Enter key password for <tomcat>
        (RETURN if same as keystore password):
# Make sure .keystore existence under JIRA running user (jira) home
[jira@linux64-jira-server ~]$ id
uid=501(jira) gid=501(jira) groups=501(jira) 
[jira@linux64-jira-server ~]$ ls -al ~/.keystore
-rw-rw-r--  1 jira jira 1362 Jun  5  2012 .keystore


2. Generate a CSR (Certificate Signing Request)

[jira@linux64-jira-server ~]$ $JAVA_HOME/bin/keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr -keystore /home/jira/.keystore


3. Submit certreq.csr to a certificate authority

Submit the generated certreq.csr to Certificate Authority for a certificate chain (DER encoded or Base 64 encoded), save it as certnew.p7b

4. Import the signed certificate into local keystore

[jira@linux64-jira-server ~]$ $JAVA_HOME/bin/keytool -importcert -alias tomcat -keystore /home/jira/.keystore -file /home/jira/certnew.p7b

5. Configure HTTPS in Tomcat

Insert below session into server.xml (Default is /opt/atlassian/jira/conf/server.xml) before </service> tag
<Connector port="8443" maxHttpHeaderSize="8192" SSLEnabled="true"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true" useBodyEncodingForURI="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />


6. Enable 8443 port from JIRA server firewall

system-config-securitylevel


7. Redirecting certain pages to HTTPS


Insert below session into web.xml (Default is /opt/atlassian/jira/atlassian-jira/WEB-INF/web.xml) before </web-app> tag <security-constraint>
<security-constraint>
   <web-resource-collection>
      <web-resource-name>all-except-attachments</web-resource-name>
      <url-pattern>*.jsp</url-pattern>
      <url-pattern>*.jspa</url-pattern>
      <url-pattern>/browse/*</url-pattern>
   </web-resource-collection>
   <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
   </user-data-constraint>
</security-constraint>


8. Debug JIRA Tomcat Server runs over HTTPS

[jira@linux64-jira-server ~]$ /opt/atlassian/jira/bin/start-jira.sh -fg


9. Restart JIRA Tomcat Server runs over HTTPS

[jira@linux64-jira-server ~]$  id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[jira@linux64-jira-server ~]$ service jira stop
[jira@linux64-jira-server ~]$ service jira start

Saturday, January 14, 2012

JIRA customization: email subject, description

Email notification subject with Status and Priority:

cd /opt/atlassian/jira/atlassian-jira/WEB-INF/classes/templates/email/subject
cat issueassigned.vm
$issue.statusObject.name $issue.priorityObject.name ($issue.key) $issue.summary

Customized Description:

Description field with template as below:

Symptoms :
--------------

Procedures :
--------------
               
Details:
---------


Steps:

cd /opt/atlassian/jira/atlassian-jira/WEB-INF/classes/templates/jira/issue/field
cp description-edit.vm org_bk_description-edit.vm
cat description-edit.vm
#customControlHeader ($action $field.id $i18n.getText($field.nameKey) $fieldLayoutItem.required $displayParameters $auiparams)
## setup some additional parameters
$!rendererParams.put("class", "long-field")
$!rendererParams.put("rows", "12")
$!rendererParams.put("wrap", "virtual")
#macro( setDescription )

Symptoms :
--------------

Procedures :
--------------
               
Details:
---------

#end
## let the renderer display the edit component
#if ($description=="" || !$description)
#set ($description = "#setDescription()")
#end
$rendererDescriptor.getEditVM($!description, $!issue.key, $!fieldLayoutItem.rendererType, $!field.id, $field.name, $rendererParams, false)
#customControlFooter ($action $field.id $fieldLayoutItem.getFieldDescription() $displayParameters $auiparams)

Restart JIRA service

service jira stop; service jira start:


Saturday, January 7, 2012

JIRA: cli interface

Creating JIRA Issue using JIRA cli interface – a minimal effort solution, easy use and maintain

1.       JDK1.6 installed
2.       Download atlassian-cli-2.4.0-distribution.zip from atlassian website
3.       Unzip atlassian-cli-2.4.0-distribution.zip, such as C:\atlassian-cli-2.4.0
4.       Edit C:\atlassian-cli-2.4.0\jira.bat
from
      java -jar "%dirPath%"/lib/jira-cli-2.4.0.jar %*
               to
      java -jar "%dirPath%"/lib/jira-cli-2.4.0.jar --server http://<my_jira_server>:8080 --user <submitter_username> --password <submitter_password> %*

Example creating an issue in JIRA

Under Dos Prompt executing command as below :
C:\atlassian-cli-2.4.0\jira.bat --action createIssue --project "MY_JIRA_PROJECT_KEY" --type "defect" --summary "Created from cli" --priority "Priority 2" --affectsVersions "3.0.1" -–components "application"
Issue JIRATST-17 created with id 10705. URL: http://<my_jira_server>:8080/browse/MY_JIRA_PROJECT_KEY -17

Note:

Priority, affectsVersdions are mandatory fields

Sunday, December 18, 2011

JIRA: duplicate JIRA database


# JIRA's XML backup utility to backup JIRA database in XML format

Administrator -> System -> Import & Export -> Backup System

# create a new latin1 database on a new database server to house JIRA's data

[root@linux64-jira-server ~]# mysql -u root -h linux64-jira-server
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.5.25-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE DATABASE latin1jiradb CHARACTER SET 'latin1';
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'latin1jira'@'linux64-jira-server' IDENTIFIED BY '********';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'latin1jira'@'linux64-jira-server';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@linux64-jira-server ~]# mysql --user=latin1jira --password=******** --database=latin1jiradb --host=linux64-jira-server

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.5.25-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye

# shutdown JIRA server

[root@linux64-jira-server ~]# service jira stop

# make a backup of JIRA HOME Directory (/var/atlassian/application-data/jira)

[root@linux64-jira-server jira]# cp -prf /var/atlassian/application-data/jira /var/atlassian/application-data/jira_backup

# remove previous dbconfig.xml from JIRA HOME Directory

[root@linux64-jira-server jira]# rm -f /var/atlassian/application-data/jira/dbconfig.xml

# restart JIRA server

[root@linux64-jira-server jira]# service jira start

# restart JIRA with JIRA Setup Wizard for configuring database connection





































# click "import your existing data" link and restore you data from the XML backup created previously








Saturday, December 17, 2011

JIRA: JIRA 4.4.4 on Red Hat 5

Install JIRA 4.4.4 (32bit) on Red Hat 5

# install MySQL Community Server 5.5 x86 64bit RPMs on Red Hat 5 server

rpm -Uvh /tmp/MySQL-shared-compat-5.5.25-1.rhel5.x86_64.rpm
rpm -Uvh /tmp/MySQL-server-community-5.5.25-1.rhel5.x86_64.rpm
rpm -Uvh /tmp/MySQL-client-community-5.5.25-1.rhel5.x86_64.rpm
/usr/bin/mysqladmin -u root password '********'

# configure MySQL DataBase for JIRA 4.4.4

mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.25-community MySQL Community Server (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> CREATE DATABASE jiradb CHARACTER SET 'utf8';
Query OK, 1 row affected (0.00 sec)


mysql> CREATE USER 'jira'@'linux64-jira-server' IDENTIFIED BY '********';
Query OK, 0 rows affected (0.00 sec)


Mysql> GRANT ALL PRIVILEGES ON *.* TO 'jira'@'linux64-jira-server';
Query OK, 0 rows affected (0.00 sec)


mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)


mysql> QUIT;

# verify jiradb creation

mysql --user=jira --password=******** --database=jiradb --host=linux64-jira-server
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.5.25-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye

# install atlassian-jira-4.4.4-x32.bin

./atlassian-jira-4.4.4-x32.bin
Unpacking JRE ...
Starting Installer ...


This will install JIRA 4.4.4 on your computer.
OK [o, Enter], Cancel [c]
o
If JIRA is already installed on this machine, please read the following information carefully.
Please choose between creating a new JIRA installation or upgrading an
existing JIRA installation.
Create a new JIRA installation. [1, Enter], Upgrade an existing JIRA installation. [2]
1


Where should JIRA 4.4.4 be installed?
[/opt/atlassian/jira]


Default location for JIRA data
[/var/atlassian/application-data/jira]


Configure which ports JIRA will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access JIRA
through your browser. The Control port is used to Startup and Shutdown JIRA.
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
1
JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start
automatically whenever the computer restarts.
Install JIRA as Service?
Yes [y, Enter], No [n]
y


Extracting files ...




Please wait a few moments while JIRA starts up. Depending on your system this may take a few minutes.
Launching JIRA ...


Setup has finished installing JIRA 4.4.4 on your computer.
JIRA 4.4.4 can be accessed at http://localhost:8080
Finishing installation ...

# configure JIRA through http://linux64-jira-server

# Connect to MySQL

Specify the database connection: External
Database Type: MySQL
Hostname: linux64-jira-server
Port: 3306
Database: jiradb
Username: jira
Password: ********

# License

Application Title: MY JIRA
Mode: Private
Base URL: http://linux64-jira-server:8080
Server ID: ABCD-EFGH-IJKL_MNOP
License Key:

# Administrator Account

Username: admin
Password: ********
Confirm: ********
Full name: JIRA Administrator
Email: jira_admin@linux64.local.lab

# Email Notification

Email Notification: Enable
Name: Default SMTP Server
From address: jira_admin@linux64.local.lab
Email prefix: [JIRA]
Server Type: SMTP Host
Host Name: smtp.linux64.local.lab
Protocol: SMTP