How to restore a Firebird 4 backup to Firebird 3

261 views Asked by At

I'm looking to migrate from Firebird 3 to 4, but in case it is needed I want to know if and how I can downgrade a database back to Firebird 3. For testing purposes I have a database running under the Firebird 4 instance. That database was originally migrated from Firebird 3 to Firebird 4 by doing a gbak backup and restore, so essentially I'm now trying to do the reverse.

I tried copying gbak from 3 and using it to backup:

gbak.exe -b -g -v -se localhost/3051:service_mgr database.fdb database.fbk -user xxx -pass xxx

And trying to restore with:

gbak.exe -c -v -se localhost/3050:service_mgr database.fbk database.fbd -user xxx -pass xxx

But I'm getting this error:

gbak: ERROR:Expected backup version 1..10. Found 11

As you can see, I have both instances of Firebird running, 3050 = Firebird 3 and 3051 = Firebird 4.

1

There are 1 answers

0
user13964273 On

For downgrade you must use gbak from lower version (in this case version 3) to create backup file from database on server of higher version.

It won't work if any stored procedure or trigger is using new BLR verbs. Then the only way to downgrade is to create a new database and pump data into it.