Simplest Enterprise Continuous Integration Solutions

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








No comments:

Post a Comment