Running two or more versions of Firebird simultaneously under Windows
by Paul Reeves 18 June 2007
Notes and Prerequisites
- This document uses the term Firebird to refer to all versions of Firebird since V1.5.0. It does not include Firebird V1.0.
- Firebird V2.1 will add a new feature (running multiple firebird services will be possible.) This feature is currently in beta and is not discussed in this document.
- This document discusses running Firebird on Windows only. Similar principles allow running multiple versions in a posix environment, but the details of this are not discussed.
- This discussion assumes you are logged in as administrator.
- An underlying premise of this document is that you want install and run two different versions of Firebird. See point 7 for info on how to run two instances of the same version.
Firebird does not currently support running multiple instances as Windows services. This fetaure will come with V2.1. However, secondary instances may be run as applications. Here is how to proceed:
Stop your primary installed Firebird service (if any.) You can use the control panel applet, or you can open a console window and use instsvc:
will show you if Firebird is currently running. Type:
to stop the service.
The server and the client library uses the FIREBIRD variable to locate various resources. This is undesirable if we run multiple instances. To check your environment for the FIREBIRD environment variable type at the console prompt:
If FIREBIRD is defined then press [Windows Key + PAUSE] to bring up the system properties dialog, switch to the advanced tab and click on the 'Environment Variables' button. Delete the FIREBIRD env var.
Check for fbclient.dll and gds32.dll in your Windows system directory. Placing the client library in <sys> is useful to simplify installation of a single engine. Like the FIREBIRD variable it can get in the way of running multiple servers. At the command prompt type:
instclient q f
If installed then type:
instclient r f
to remove it. Then repeat for gds32.dll:
instclient q g instclient r g
If something goes wrong at this point it will be necessary to remove the files by hand and manually edit the registry entries for shared libraries.
Install a second version of Firebird using the binary installer.
- DO NOT accept the default directory.
- DO NOT install Firebird as a service. (ie, run as an application.)
- DO NOT install the guardian.
- DO NOT install the control panel applet.
- DO NOT copy gds32.dll to the system dir.
- DO NOT start Firebird at the end of the installation session.
Edit the newly installed firebird.conf file in your favourite text editor. Some or all of the following settings need to be modified from the defaults. (Remember to remove the # - all text after it is considered a comment.)
#RemoteServiceName = gds_db #RemoteServicePort = 3050
You can use a different RemoteServiceName, but if you do it needs to be added to the services file. (Typically found in <sys>driversetc). Generally, it is easier and quicker to just use a port number, ie, change the value assigned to RemoteServicePort.
NetBeui and pipes:
#RemotePipeName = interbas #CreateInternalWindow = 1 #IpcName = FirebirdIPI
Not discussed in this document.
Other settings of possible interest:
#RemoteAuxPort = 0
This is used for events. It should not need changing unless you are behind a firewall. ie, if you have changed the value used by your primary installation you should also set it (to a different value) for secondary installations. And don't forget to open the port on the firewall:
Allows you to specify the network interface that the server listens on. The default is all.
Restart your primary server as a service or application as desired. You can use the control panel applet for this, or else instsvc.
Start your secondary server from the console prompt, or create a shortcut and place it somewhere convenient. The important point is to use the -a switch to start Firebird as an application:
Connect to your server with syntax similar to the following:
if you have defined a service name.
The Firebird V1.5 release notes documents a method of specifying a port number when launching a server. This is useful if you want to run two instances of the same server from a single installation. No modifications of the firebird.conf file are required.
The same document has information about using the NetBeui protocol to make connections.