Migrating RMsis from H2 to MySQL
Introduction
There have been some requests, where RMsis users entered some critical data in the embedded database during the evaluation period and at a later date wish to migrate to a production ready DataBase.
The process is not straightforward and we have worked out a solution, which is presented below.
However, specific installations may have some unique issues. If you face any such issue, please contact [email protected]. Also see the notes at the end of this article.
Supported Platforms
Linux OS has been used in the procedure described below. For migration on MS Windows platform, please use windows versions of all the listed tools. One of our customers has migrated on Windows 7 Platform and shared the following additional points: When we installed SQuirrel SQL on our Windows 7 machine, some plugins where not correctly installed although they were selected for installation in the installer. Especially "Copy Table" did not show up in the context menu. After manually installing the plugins in the right place and restarting the tool the context menu was there.
Resources / Tools Required
You must have JAVA installed on your machine. SQuirrel SQL (http://squirrel-sql.sourceforge.net/) VIM JDBC database drivers h2-1.3.160.jar mysql-connector-java-5.1.6.jar Blank RMsis database (be sure you use correct database version) rmsis_164_blank.sql for RMsis-1.6.4 rmsis_167_blank.sql for RMsis-1.6.7 rmsis_168_blank.sql for RMsis-1.6.8 rmsis_170_blank.sql for RMsis-1.7.0 rmsis_171_r168_blank.sql for RMsis-1.7.1-r168 rmsis_171_r183_blank.sql for RMsis-1.7.1-r183 rmsis_171_r200_blank.sql for RMsis-1.7.1-r200 rmsis_178_r206_blank.sql for RMsis-1.7.8-r206 rmsis_186_r297_blank.sql for RMsis-1.8.6-r297
Perquisite
Jira admin access MySQL root access
Procedure
1. Installing SQuirrel SQL a. Download SQuirrel SQL from link given above b. Follow installation instructions given on http://www.squirrelsql.org/#installation c. Make sure, you enable all the plugins, specially H2 and MySQL database support d. Copy provided H2 and MySQL driver file in
7. Preparing H2 database for migration a. In alias section click on rmsis-h2 (connect to it) b. On left hand pane select rmsis-h2 > RMSIS > PUBLIC c. Go to SQL pane and write following queries, one per line i. ALTER TABLE PROJECT ALTER COLUMN VERSION RENAME TO VERSION_NEW; ii. ALTER TABLE TEST_CASE ALTER COLUMN VERSION RENAME TO VERSION_NEW; iii. ALTER TABLE REQUIREMENT_HIERARCHY ALTER COLUMN LEVEL RENAME TO LEVEL_NEW; (Only for RMsis-1.7.1- r183 and earlier versions) iv. ALTER TABLE REQUIREMENT_BASELINE ALTER COLUMN LEVEL RENAME TO LEVEL_NEW; (Only for RMsis-1.7.1-r183 and earlier versions) v. ALTER TABLE ATTACHMENT ALTER COLUMN SIZE RENAME TO SIZE_NEW; (Only for RMsis-1.7.1-r183 and earlier versions) vi. ALTER TABLE REPORTING ALTER COLUMN DOMAIN RENAME TO DOMAIN_NEW; vii. ALTER TABLE TEST_STEP ALTER COLUMN ACTION RENAME TO ACTION_NEW; (Only for RMsis-1.7.1-r168 and later versions) viii. Update rmsis_sync_status SET LAST_SYNC_AT='1980-01-01 00:00:00' WHERE LAST_SYNC_AT < '1980-01-01 00:00:00'; (O nly for RMsis-1.8.6-r297) d. Run queries (CTRL + ENTER) e. Now your H2 database is ready for migration
8. Connecting to MySQL database
a. Go to Alias > New Alias b. Put rmsis-mysql as alias name c. Select "MySQL Driver" for driver d. In URL put jdbc:mysql://
9. Copying database
a. Go to Alias pane b. Connect to "rmsis-h2" c. Go to rmsis-h2 > RMSIS > PUBLIC > TABLE d. Right click on TABLE and select "Copy Table" from context menu
10. Pasting database
a. Go to Alias pane b. Connect to "rmsis-mysql" c. Go to "rmsis-mysql > rmsis_db_1 > TABLE d. Right click on TABLE and select "Paste Table" from context menu e. it will take some time according to size of your database f. once it is done successfully, close SQuirrel SQL Client
11. Preparing MySQL database from step 10
a. Open terminal and connect to rmsis_db_1 using MySQL i. mysql -u
12. Loading blank RMsis database to second RMsis database (created in step 4, rmsis_db_2)
a. Copy RMsis blank database (rmsis_blank_db.sql) attached to work folder b. Run command i. mysql -u
a. Run command i. mysql -u
14. You are almost ready now ...
15. Replacing database pointer in RMsis
a. Start your Jira Server (switched off in step 2) b. Login using Administration c. Go to RMsis > RMsis Configuration (click on down arrow near RMsis tab for RMsis configuration) d. Open "Database Configuration" tab e. Change "Database Connection" to External f. Database Type, "MySQL" g. Hostname, your MySQL server host name (localhost if it runs local) h. Port, your MySQL server port (3306 is default for MySQL) i. Database, rmsis_db_2 (replace it, if you used different name for second database in step 4) j. Username, database username k. Password, database password l. Save configuration
16. It will take some time to start RMsis server again, once it is done press "Finish"
17. Go to RMsis, and test if everything is fine.
Have Issues ?
If the process breaks down in between or if you have any issues, do not proceed and contact [email protected]. looking at the complexity of migration, it may not be practical to exchange information on mails. At the minimum, we will need mechanism to view your screen, either through WebEx or Skype. Please ensure that this is possible, before contacting support.