Migrating to PostgreSQL
To switch to a PostgreSQL database, install PostgreSQL and follow the steps below. When they are used together, Fisheye and Crucible share the same external database.
Please note that during the migration of database servers, the Fisheye/Crucible instance will not be available to users or to external API clients.
Step 1. Install and Create a PostgreSQL Database
- The JDBC drivers for PostgreSQL are bundled with Fisheye/Crucible, although they are not the latest version. Skip to Step 2 if this meets your needs.
In case you run PostgreSQL 9.6, we recommend installing the 42.x.x driver version from the PostgreSQL website.
If you want to install a specific, different version of the bundled JDBC driver, download the PostgreSQL JDBC driver
.jarfile from the PostgreSQL website and copy the
.jarfile to your
FISHEYE_INST/libdirectory (create the
lib/directory if it doesn't already exist). Move the existing JDBC
.jarfile to another location (and back it up). Restart Fisheye/Crucible to have it pick up the new driver.
Create a new database user (replacing 'username' and 'password' with the appropriate values):
$ psql > create user username password 'password';
Create a UTF-8 database and make the newly created user the owner:
> create database crucible ENCODING 'UTF-8' OWNER username;
Make sure the user has full access to the database:
> grant all on database crucible to username;
Step 2. Configure Fisheye/Crucible to use PostgreSQL, 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.
Option 1: Migrate using the UI (Fisheye/Crucible Administration)
- Navigate to the
Databasepage in Fisheye/Crucible's Administration console.
To log in to the Admin area, you can either:
- click Administration at the foot of the page.
- navigate to
HOSTNAMEis the name of the server on which you installed Fisheye. where
Once logged in as an administrator you can also get to the Admin area by clicking the 'cog' menu in the Fisheye/Crucible header, and choosing Administration.
- Choose Edit > Test Connection to verify that Fisheye/Crucible can log in to the existing database.
PostgreSQLfrom the database Type.
- Fill in the appropriate fields, using the same connection details as used when creating the PostgreSQL database in Step 1 above.
- Driver Location: either your own PostgreSQL JDBC or the Bundled one that came with Fisheye
- URL: create this field by replacing the host, port, and database name with your own
(i.e. jdbc:postgresql://localhost:5432/<dbname> e.g. jdbc:postgresql://localhost:5432/crucible)
- Username: your DB username
- Password: your DB password
- Minimum Pool Connections: 5 is the default
- Maximum Pool Connections: 20 is the default
- Parameters: (one per line)
- Click Test Connection to validate the values.
Screenshot: Testing the Connection
If this fails, verify that you have the PostgreSQL JDBC driver
.jarfile in the classpath (by placing the
FISHEYE_INST/lib). 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.
- 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. If successful, the following message is displayed:
Screenshot: Migrating the Database
Option 2: Migrate using the command line
- Create a backup of the
sqldata from the Fisheye/Crucible instance. Information on how to create a backup can be found at Backing up and restoring FishEye data / Backing up and restoring Crucible data.
Run the following command from the
<FishEye installation directory>/bindirectory:
$ ./fisheyectl.sh restore --sql \ --file /path/to/backup.zip \ --dbtype postgresql \ --jdbcurl jdbc:postgresql://hostname/dbname \ --username crucible \ --password password
- When the import is complete, Fisheye/Crucible can be started and will use PostgreSQL.