Simplest Enterprise Continuous Integration Solutions

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"