How to access Firebird database file from TFS4JIRA Synchronizer
Mac OS instructions
Connecting to the database using isql (Firebird Interactive SQL Utility)
Download & install Firebird 3.0.5 https://firebirdsql.org/en/firebird-3-0.
At the time I’m writing this page the Firebird series 3.0 is the latest one available. Do not install Firebird 2.0 series, it is not compatible and does not work with our embedded Firebird database version.
The Firebird installation will be located inside the following directory /Library/Frameworks/Firebird.framework.
In order to use the command-line Firebird Administration program isql, you need to make the binary file available to your Terminal session by adding it to your PATH. You can do that by editing your .bash_profile or .profile file in your home directory, appending the following lines:
export FIREBIRD_HOME=/Library/Frameworks/Firebird.framework/Resources export PATH=$PATH:$FIREBIRD_HOME/bin
Restart your Terminal session and navigate to the folder where your Firebird database file is located.
Use the following isql command to access the database file:
sudo isql -user <USER> -password <PASSWORD> <DATABASE_FILE_NAME>
It is important to use sudo to avoid running into permission problems when attempting to open the file with isql.
You’ll find the credentials to open the database file inside the Web.config file. This is the file from where the TFS4JIRA Synchronizer is reading the database connection details.
Replace <USER> with sysdba
Replace <PASSWORD> with masterkey
Finally, we need to point to the database file.
If you accessed the directory where the file is located as suggested in step 4, you can simply put the file name there.
Replace <DATABASE_FILE_NAME> with CONFIG.FDB
If you are not in the same directory where the file is located you’ll need the full path to the file.
Replace <DATABASE_FILE_NAME> with full/path/to/CONFIG.FDB
Here’s an example of what the isql will look like:
sudo isql -user sysdba -password masterkey CONFIG.FDB
Running SQL commands
Once you’ve connected to the Firebird database file using the steps mentioned above, you’ll see that you have entered the SQL session. Here’s an example of what you should see in your Terminal:
brosa$ sudo isql -user sysdba -password masterkey /Users/brosa/Downloads/CONFIG.FDB Database: /Users/brosa/Downloads/CONFIG.FDB, User: SYSDBA SQL>
From this moment on you can start running SQL commands. A few important things to keep in mind when building an SQL statement:
Table names and column names should be enclosed by double quotes.
Values should be enclosed by single quotes.
Here are a few useful commands:
SQL> show tables;
This will display all tables inside the TFS4JIRA Synchronizer database.
select "Name" from "SyncProfiles";
This will give you a list of all sync profiles an their names.
select * from "SyncProfiles" where "Name" = 'Test';
This will give you all details from the sync profile called Test (enclosed by single quotes because this is the name of the sync profile) in the SyncProfiles table.
update "SyncProfiles" set "InitialSyncStatusInt" = 0 where "Name" = 'Test';
This will set the status of the initial sync for the Test sync profile in the sync profiles table to 0.
Additional information & reading
You’ll find more information about isql (Firebird Interactive SQL Utility) here: https://firebirdsql.org/manual/isql.html
Firebird Interactive SQL Utility installation instructions for Mac OS here: https://firebirdsql.org/file/documentation/papers_presentations/html/paper-fb-macosx-install.html