Crucible 2.10 : Migrating to MySQL

This page describes how to use FishEYe/Crucible with both MySQL Enterprise Server and MySQL Community Server.

To switch to a MySQL database, install MySQL and then follow the steps below. Please note that during the migration of database servers, the FishEye/Crucible instance will not be available to users or to external API clients.

(warning) Note that for FishEye 2.9+, the JDBC driver for MySQL is not bundled with FishEye/Crucible (due to licensing restrictions).

Prerequisites

Before you begin:

  1. Install a supported version of MySQL. Check the Supported platforms page for the exact versions that are supported.
  2. Download and install the JDBC driver, if necessary. Note that for FishEye 2.9+, the JDBC driver for MySQL is not bundled with FishEye/Crucible (due to licensing restrictions).
    1. Download the MySQL Connector/J JDBC driver from the MySQL download website.
    2. Expand the downloaded zip/tar.gz file.
    3. Copy the .jar file to your FISHEYE_INST/lib directory. If the lib/ directory doesn't already exist, you will need to create it. 
    4. Restart FishEye/Crucible.

Step 1. Create a MySQL Database

  1. Create a UTF-8 Database:

    CREATE DATABASE fisheye CHARACTER SET utf8 COLLATE utf8_bin;
  2. You will also need to set the Server Characterset to utf8. This can be done by adding the following in my.ini for Windows or my.cnf for other operating systems (create the file at /etc/my.cnf if it doesn't already exist). It has to be declared in the Server section, which is the section after [mysqld]:

    [mysqld]
    character-set-server=utf8
    
  3. Use the status command to verify database character encoding information.
    First select the fisheye database: mysql> use fisheye;
    Then issue the mysql> status; command:

    Screenshot: Using the MySQL Status Command

  4. Create a user that can log in from the host that FishEye/Crucible is running on and make sure that the user has full access to the newly created database. In particular, the user should be allowed to create and drop tables, indexes and other constraints.

    For instance, when FishEye/Crucible and MySQL run on the same machine (accessible through localhost), issue the following commands (replacing username and password with the appropriate values):

    mysql> grant all on fisheye.* to 'username'@'localhost' identified by 'password';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.01 sec)
    

Step 2. Configure FishEye/Crucible to use MySQL, and Migrate Data

In order to migrate to a different database backend, you must create a backup of sql data, configure the database and finally import the data via a backup restoration process. This can be done from either the FishEye/Crucible administration console, which streamlines the process, or via the command line tool which FishEye/Crucible provides.

From FishEye/Crucible's Administration

  1. Navigate to the Database page in FishEye/Crucible's Administration console
  2. Then click 'Test Connection' to verify that FishEye/Crucible can log in to the database:
  3. Select MySQL from the database type
  4. Fill in the appropriate fields, replacing the host, port, database name, username and password as required
  5. Click on Test Connection to validate the values

    Screenshot: Testing the Connection



    If this fails, verify that you have the MySQL JDBC driver .jar file in the classpath (see Prerequisites section above for instructions on how to install the driver). Also, ensure that the database user can log in to the database from the machine that FishEye/Crucible is running on and that all the required privileges are present.
  6. Click Save & Migrate to start the migration process.

    During the migration process (which will take several minutes, depending on the size of your database and network throughput), the product will be inaccessible to users and external API clients. Users will see a maintenance screen that informs them of the process. Should the migration fail for any reason, FishEye/Crucible will not switch to the new database and report on the encountered problems. Because the destination database may now contain some, but not yet all data, drop all tables, indexes and constraints before attempting a new migration.

    Screenshot: Migrating the Database

From the command line

  1. Create a backup of the sql data from the FishEye/Crucible instance. Read Backing up and restoring FishEye data and Backing up and restoring Crucible data for information on how to create a backup.
  2. Run the following command from the bin directory in FISHEYE_INST

    $ ./fisheyectl.sh restore --sql \
            --file /path/to/backup.zip \
            --dbtype mysql \
            --jdbcurl jdbc:mysql://hostname/dbname \
            --username crucible \
            --password password
    
  3. When the import is complete, FishEye/Crucible can be started and will use MySQL.