This material was created with the support and sponsorship of the company IBSurgeon, developer of HQbird, advanced distribution of Firebird for enterprises,and Mass Migration Framework for Firebird, toolset to perform migration of many (100+) servers during several days.
The material is released under the Public Documentation License https://www.firebirdsql.org/file/documentation/html/en/licenses/pdl/public-documentation-license.html
Introduction
This article is intended primarily for those who plan to upgrade the Firebird DBMS to version 5.0 in the near future. Many administrators still use Firebird 2.5, but plan to upgrade to version 5.0. That is why the process of migration from Firebird versions 2.5, 3.0 and 4.0 is described here.
Manual installation of Firebird 5.0 in Windows
The process of installation from a zip archive is described below. Even if you install Firebird from a special installation package, you may still need to change some settings after installation. In addition, manual installation allows you to install multiple versions of Firebird on one machine.
Download the archive of the corresponding bitness and unpack it to the directory where the Firebird server will be located.
Next, you need to create the SYSDBA
user. For administrators who are migrating from Firebird 3.0 or 4.0, this operation is not new. In Firebird 2.5 and earlier, after installation, the SYSDBA user always existed and had the default password masterke, which had to be changed immediately.
Initialization of SYSDBA
Starting from Firebird 3.0, the SYSDBA
user is not initialized by default (for the SRP
user management plugin), so you need to explicitly create a user and specify a password for him. This can be done in two ways: using the console tool for executing interactive queries isql
.exe and the console tool for managing the security database gsec.exe
.
Note
|
Note
Depending on the location of Firebird, these utilities may require running with administrator privileges.
|
Initialization of SYSDBA using ISQL
Run the tool for executing interactive queries isql.exe
.Connect to the security database in embedded server mode, specifying the user SYSDBA
without a password.The user SYSDBA
does not exist in the security database yet, but in embedded mode the user and his password are not checked, and Firebird trusts any specified user name.Execute the SQL query to create the user SYSDBA
:
CREATE USER SYSDBA PASSWORD '<password>';
The user SYSDBA is initialized, you can exit the interactive mode.
c:\Firebird\5.0>isql security.db -user SYSDBA Database: security.db, User: SYSDBA SQL> CREATE USER SYSDBA PASSWORD 'm8ku234pp'; SQL> exit;
Initialization of SYSDBA using GSEC
Run gsec.exe
, specifying the user SYSDBA
and the database security.db
.Execute the command to add the user SYSDBA:
add SYSDBA -pw <password>
c:\Firebird\5.0>gsec -user SYSDBA -database security.db gsec is deprecated, will be removed soon GSEC> add SYSDBA -pw m8ku234pp GSEC> quit
Warning
|
Warning
The tool |
Configuration
Before installing and running Firebird as a service, you need to choose the server mode.
Server mode
By default, Firebird will start in SuperServer
mode. If you want the server to run in another architecture, you need to change the value of the ServerMode
parameter in firebird.conf
. Uncomment it (remove the hash) and set the desired mode: Super
, SuperClassic
or Classic
. For example, to set Classic:
ServerMode = Classic
Authorization from Firebird 2.5 client libraries
In Firebird 5.0, secure password authentication (SRP) is used by default. Clients of Firebird 2.5 and earlier versions used traditional authentication (Legacy_Auth
), which is disabled in Firebird 5.0 by default, as it is not secure.
To support traditional authentication, you need to change the following parameters AuthServer, UserManager and WireCrypt.
AuthServer = Srp256, Srp, Legacy_Auth UserManager = Srp, Legacy_UserManager WireCrypt = Enabled
After the above manipulations, we will have two active user managers, by default the first one in the UserManager list is active.
Important
|
Important
Users with the same name in different user managers are different users and they may have different passwords.This applies to both |
Note
|
If you do not need support for secure password authentication (SRP), then remove the |
We have already created SYSDBA in the SRP
user manager. In Legacy_UserManager
, SYSDBA
already exists, with the standard password masterkey, which needs to be changed. Let’s do this using the isql
tool. In the ALTER USER
statement, you must specify the Legacy_UserManager
user manager.
c:\Firebird\5.0>isql security.db -user SYSDBA Database: security.db, User: SYSDBA SQL> ALTER USER SYSDBA SET PASSWORD 'er34gfde' USING PLUGIN Legacy_UserManager; SQL> exit;
Setting the default connection time zone
Starting from Firebird 4.0, new date and time types with time zone support are available.
Even if you are not going to use types with time zones in the near future, you need to consider that the expressions CURRENT_TIMESTAMP
and CURRENT_TIME
now return data types with time zones. There is a compatibility mode that allows you to convert types with time zones to types without time zones. However, such a conversion may work incorrectly if the connection time zone is set incorrectly.
Usually the session time zone is set on the client side. If the time zone on the client side is not set, then the time zone of the operating system is used by default.You can also set the default session time zone using the configuration parameter DefaultTimeZone.
DefaultTimeZone = Europe/Moscow
Running multiple instances of Firebird simultaneously
Here it is assumed that you want to run instances of different versions of Firebird, each of which is installed in its own directory.
To run multiple instances of Firebird simultaneously, you need to separate them by different tcp ports (if, of course, the listener is running in TCP/IP listening mode).To do this, you need to change the RemoteServicePort parameter in firebird.conf.
For example, if you already have one server that listens on port 3050, then you need to set any other free port, for example 3051. In this case, you will need to specify the new port in the connection string (except when the application and Firebird client have access to firebird.conf with the changed default port number).
RemoteServicePort = 3051
You also need to set unique values for the IpcName parameter for each instance of the DBMS server. This will avoid error messages in firebird.log
. These errors are not critical if you do not use the XNET protocol. However, if it is used, then you should keep in mind that this parameter will have to be changed on the client side through DPB.
How to create firebird.conf for better performance?
To optimize the performance of your VM/hardware, consider generating firebird.conf and databases.conf for version 5 with the Configuration Calculator for Firebird, a free tool provided by IBSurgeon. These configurations will outperform the default settings.Just remember, you’ll need to manually implement the suggested changes from sections above into the configuration produced by the Calculator.
Installing and running Firebird as a service
The instsvc.exe
utility writes, deletes or changes information about the server startup in the service base of the operating system. In addition, it allows you to manage the startup and shutdown of the service.
If you run it without parameters, it will display help on commands and parameters.
instsvc Usage: instsvc i[nstall] [ -a[uto]* | -d[emand] ] [ -g[uardian] ] [ -l[ogin] username [password] ] [ -n[ame] instance ] [ -i[nteractive] ] sta[rt] [ -b[oostpriority] ] [ -n[ame] instance ] sto[p] [ -n[ame] instance ] q[uery] r[emove] [ -n[ame] instance ] '*' denotes the default values '-z' can be used with any other option, prints version 'username' refers by default to a local account on this machine. Use the format 'domain\username' or 'server\username' if appropriate.
Important
|
Important
The |
To install the service, you need to enter the command
instsvc install
In this case, Firebird will be installed as a service with the name "Firebird Server – DefaultInstance". This service will start automatically when the OS starts, under the LocalSystem account, intended for services.
If you need to install multiple instances of Firebird running as services, then you need to assign them different names using the -n
option
instsvc install -n fb50
To start the service, use the command
instsvc start
If the service was installed with a name different from the default, then you need to use the -n
switch
instsvc start -n fb50
To stop the service, use the command
instsvc stop
If the service was installed with a name different from the default, then you need to use the -n
switch
instsvc stop -n fb50
To remove the service, you need to enter the command
instsvc remove
If the service was installed with a name different from the default, then you need to use the -n
switch
instsvc remove -n fb50
To view all Firebird services installed in the system, use the command
instsvc query
Firebird Server - fb30 IS installed. Status : running Path : C:\Firebird\3.0\firebird.exe -s fb30 Startup : automatic Run as : LocalSystem Firebird Server - fb40 IS installed. Status : running Path : C:\Firebird\4.0\firebird.exe -s fb40 Startup : automatic Run as : LocalSystem Firebird Server - fb50 IS installed. Status : running Path : C:\Firebird\5.0\firebird.exe -s fb50 Startup : automatic Run as : LocalSystem
Using install_service.bat and uninstall_service.bat
To simplify the procedure of installing and uninstalling services in the ZIP archive, two BAT files are supplied with Firebird: install_service.bat
and uninstall_service.bat
.
In this case, the procedure of installing Firebird as a service looks like this
install_service.bat
In this case, the procedure of removing the Firebird service looks like this
uninstall_service.bat
If you need to assign a different name to the service, then specify this name as an argument
install_service.bat fb50
If the service was installed with a name different from the default, then specify this name as an argument
uninstall_service.bat fb50
Installing the client
If you are talking about installing only the client part, then the file fbclient.dll is required. The Firebird 5.0 client requires the installed Microsoft Runtime C++ 2015-2022 of the corresponding bitness. If this library is not installed, you can copy additional libraries that are supplied in the ZIP archive under Windows msvcp140.dll
and vcruntime140.dll
(and vcruntime140_1.dll
for 64-bit installation).
It is desirable that the file firebird.msg be located next to fbclient.dll
. Most error messages are already contained in fbclient.dll
, but if you are going to use console utilities, the file firebird.msg must be present.
Unlike Firebird 2.5 and Firebird 3.0, the client library also requires ICU files (icudt63.dll
, icuin63.dll
, icuuc63.dll
and icudt63l.dat
). Previously, the ICU library was required only by the server. Now it may be required by the client part, if you are going to work with data types TIMESTAMP WITH TIME ZONE
and TIME WITH TIME ZONE
. The ICU library is also required when calling the functions UtilInterface::decodeTimeTz()
and UtilInterface::decodeTimestampTz()
.
Note
|
Note
In Windows 10, the ICU library supplied with the operating system can be used. |
If you need traffic compression when working over TCP/IP, then you will need the library zlib1.dll
.
You may need the library plugins/chacha.dll
if you are going to use the ChaCha traffic encryption plugin. This plugin is used by default starting from Firebird 4.0, as it is the first in the list of values in the configuration parameter WireCryptPlugin = ChaCha, Arc4
.
Note
|
Note on loading plugins
However, there is an important feature. This behavior can play a cruel joke on you. The thing is that the 64-bit installer places the 32-bit library fbclient.dll in the folder Error loading plugin ChaCha. Module C:\Firebird\5.0\plugins/ChaCha exists but can not be loaded. unknown Win32 error 193. In this case, the 32-bit To fix this error, just put the file firebird.conf in the folder $(fbroot)/WOW64. |
The library fbclient.dll
, as well as other files of the client library, must be located either next to the application, or in one of the directories where the search is performed, for example added to PATH
or the system directory for placing public libraries (system32
or SysWOW64
).
Important
|
Important
Placing the client library in |
Using instclient
To deploy the Firebird client library in the Windows system directory, use the command
instclient install fbclient
Important
|
Important
The |
Installing the embedded version
Starting from version Firebird 3.0, the embedded version is not distributed separately. You can use the same set of files as both a network server and an embedded server. But, if you need an embedded set of minimal size, then the structure of files and directories for Firebird 5.0 embedded is as follows:
-
intl
-
fbintl.conf
-
fbintl.dll
-
-
plugins
-
engine13.dll
-
-
firebird.conf
-
icudt63l.dat
-
fbclient.dll
-
ib_util.dll
-
icudt63.dll
-
icuin63.dll
-
icuuc63.dll
-
msvcp140.dll
-
vcruntime140.dll
-
vcruntime140_1.dll
-
firebird.msg
If necessary, you can also copy the executable files of the utilities fbsvcmgr.exe
, fbtracemgr.exe
, gbak.exe
, gfix.exe
, gstat.exe
, isql.exe
, nbackup.exe
.If you are going to use gbak
with the -zip
switch, then you will also need the library zlib1.dll
.
Note
|
Note
For those who are migrating from Firebird 2.5, you should consider 2 points:
|