Downgrade firebird from 2.x into 1.5.x

Uniquely, downgrade is required. That happened in my production environment.
In generally, there is no official tools supporting such operation however I found on some forum solution which I successfuly tested.

The clue is to make backup with tool gbak derived from version you wish to downgrade (in my situation it is 1.5.6).

First of all, you need to prepare server for this operation.
Edit config file (usually /opt/firebird/firebird.conf) and change variable to

RemoteBindAddress=127.0.0.1

Now, restart server.
For your security, try to properly close your data. Do this with original gbak tool.

/opt/firebird/bin/gfix $Database -user $User -password $Passwd -commit all
/opt/firebird/bin/gfix $Database -user $User -password $Passwd -shut single -tran 180
/opt/firebird/bin/gfix $Database -user $User -password $Passwd -shut single -force 120
/opt/firebird/bin/gfix $Database -user $User -password $Passwd -validate -full
/opt/firebird/bin/gfix $Database -user $User -password $Passwd -mend -full -ignore

Now, you can make main operation, backup with gbak from version you are downgrading. I simply copied this application from version 1.5.6 of the Firebird RDBMS and saved it as gbak156 into firebird /bin directory.

/opt/firebird/bin/gbak156 -g -ig -b -k -e -v -t -user $User -password $Passwd $Database $DatabaseDestination

If everything goes ok you have backup of your data which are conform to version of 1.5.6 – simply move new craeted file into destination server with Firebird 1.5.6 and restore your data, e.g.

/opt/firebird/bin/gbak -b -g -ig -e -v -t -user $User -password $Passwd $Database $Backupfile
    • Leo
    • July 10th, 2013

    Very helpful. Works for me on Windows. Just used -b for backup and -r for restore, no other switches.

  1. No trackbacks yet.