Migrating Firebird Security Databases from 1.x.x to 2.x.x

One of the main goals of Firebird 2.0 was to enhance database security.  In order to achieve this, certain changes were made to the security database which made it incompatible with prior versions.  So now, unlike prior upgrades, you can’t just copy your old security database to the new installation directory.  If you try to do this you will get a “Cannot attach to password database” error when you try to connect to the server.  You have to put your old security database through a conversion process to be able to use it with the new Firebird.  Here is how it is done:

  1. Copy your existing security database (security.fdb or isc4.gdb) to a safe place.  NOT in the new Firebird installation directory.
  2. Install Firebird 2.x.
  3. Convert your existing security database to ODS 11 by using the gbak tool to back up and restore the database.
  4. Connect to your existing secuity database (newly converted to ODS 11) using the isql tool and run the security database update script using the input command.  This script can be found in misc\upgrade\security\security_database.sql in the Firebird 2.x installation directory.
  5. Stop the Firebird service.
  6. Save a copy of the Firebird 2.x security database (security2.fdb) in a safe place just in case.
  7. Copy the updated security database into the Firebird 2.x installation directory and rename it security2.fdb.
  8. Restart Firebird

You should now be able to connect to Firebird using all of your old user names and passwords.

Leave a Reply